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.896.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_jwt_key`]
325#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum EditGuestJwtKeyError {
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`edit_instance_groups`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum EditInstanceGroupsError {
335    UnknownValue(serde_json::Value),
336}
337
338/// struct for typed errors of method [`edit_large_file_storage_config`]
339#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum EditLargeFileStorageConfigError {
342    UnknownValue(serde_json::Value),
343}
344
345/// struct for typed errors of method [`edit_slack_command`]
346#[derive(Debug, Clone, Serialize, Deserialize)]
347#[serde(untagged)]
348pub enum EditSlackCommandError {
349    UnknownValue(serde_json::Value),
350}
351
352/// struct for typed errors of method [`edit_success_handler`]
353#[derive(Debug, Clone, Serialize, Deserialize)]
354#[serde(untagged)]
355pub enum EditSuccessHandlerError {
356    UnknownValue(serde_json::Value),
357}
358
359/// struct for typed errors of method [`edit_teams_command`]
360#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum EditTeamsCommandError {
363    UnknownValue(serde_json::Value),
364}
365
366/// struct for typed errors of method [`edit_variable_expiration_handler`]
367#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum EditVariableExpirationHandlerError {
370    UnknownValue(serde_json::Value),
371}
372
373/// struct for typed errors of method [`edit_webhook`]
374#[derive(Debug, Clone, Serialize, Deserialize)]
375#[serde(untagged)]
376pub enum EditWebhookError {
377    UnknownValue(serde_json::Value),
378}
379
380/// struct for typed errors of method [`edit_workspace_default_app`]
381#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(untagged)]
383pub enum EditWorkspaceDefaultAppError {
384    UnknownValue(serde_json::Value),
385}
386
387/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
388#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum EditWorkspaceDeployUiSettingsError {
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`edit_workspace_git_sync_config`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum EditWorkspaceGitSyncConfigError {
398    UnknownValue(serde_json::Value),
399}
400
401/// struct for typed errors of method [`enable_datatable_migrations`]
402#[derive(Debug, Clone, Serialize, Deserialize)]
403#[serde(untagged)]
404pub enum EnableDatatableMigrationsError {
405    UnknownValue(serde_json::Value),
406}
407
408/// struct for typed errors of method [`exists_username`]
409#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum ExistsUsernameError {
412    UnknownValue(serde_json::Value),
413}
414
415/// struct for typed errors of method [`exists_workspace`]
416#[derive(Debug, Clone, Serialize, Deserialize)]
417#[serde(untagged)]
418pub enum ExistsWorkspaceError {
419    UnknownValue(serde_json::Value),
420}
421
422/// struct for typed errors of method [`export_pg_schema`]
423#[derive(Debug, Clone, Serialize, Deserialize)]
424#[serde(untagged)]
425pub enum ExportPgSchemaError {
426    UnknownValue(serde_json::Value),
427}
428
429/// struct for typed errors of method [`generate_initial_datatable_migration`]
430#[derive(Debug, Clone, Serialize, Deserialize)]
431#[serde(untagged)]
432pub enum GenerateInitialDatatableMigrationError {
433    UnknownValue(serde_json::Value),
434}
435
436/// struct for typed errors of method [`get_billable_seats`]
437#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(untagged)]
439pub enum GetBillableSeatsError {
440    UnknownValue(serde_json::Value),
441}
442
443/// struct for typed errors of method [`get_cloud_quotas`]
444#[derive(Debug, Clone, Serialize, Deserialize)]
445#[serde(untagged)]
446pub enum GetCloudQuotasError {
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`get_copilot_info`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetCopilotInfoError {
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`get_copilot_settings_state`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum GetCopilotSettingsStateError {
461    UnknownValue(serde_json::Value),
462}
463
464/// struct for typed errors of method [`get_data_table_table_schema`]
465#[derive(Debug, Clone, Serialize, Deserialize)]
466#[serde(untagged)]
467pub enum GetDataTableTableSchemaError {
468    UnknownValue(serde_json::Value),
469}
470
471/// struct for typed errors of method [`get_datatable_acl`]
472#[derive(Debug, Clone, Serialize, Deserialize)]
473#[serde(untagged)]
474pub enum GetDatatableAclError {
475    UnknownValue(serde_json::Value),
476}
477
478/// struct for typed errors of method [`get_datatable_full_schema`]
479#[derive(Debug, Clone, Serialize, Deserialize)]
480#[serde(untagged)]
481pub enum GetDatatableFullSchemaError {
482    UnknownValue(serde_json::Value),
483}
484
485/// struct for typed errors of method [`get_datatable_migrations_status`]
486#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(untagged)]
488pub enum GetDatatableMigrationsStatusError {
489    UnknownValue(serde_json::Value),
490}
491
492/// struct for typed errors of method [`get_datatable_permissions`]
493#[derive(Debug, Clone, Serialize, Deserialize)]
494#[serde(untagged)]
495pub enum GetDatatablePermissionsError {
496    UnknownValue(serde_json::Value),
497}
498
499/// struct for typed errors of method [`get_default_scripts`]
500#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum GetDefaultScriptsError {
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`get_dependency_map`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum GetDependencyMapError {
510    UnknownValue(serde_json::Value),
511}
512
513/// struct for typed errors of method [`get_dependents`]
514#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(untagged)]
516pub enum GetDependentsError {
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`get_dependents_amounts`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum GetDependentsAmountsError {
524    UnknownValue(serde_json::Value),
525}
526
527/// struct for typed errors of method [`get_deploy_to`]
528#[derive(Debug, Clone, Serialize, Deserialize)]
529#[serde(untagged)]
530pub enum GetDeployToError {
531    UnknownValue(serde_json::Value),
532}
533
534/// struct for typed errors of method [`get_dev_workspace`]
535#[derive(Debug, Clone, Serialize, Deserialize)]
536#[serde(untagged)]
537pub enum GetDevWorkspaceError {
538    UnknownValue(serde_json::Value),
539}
540
541/// struct for typed errors of method [`get_fork_creation_status`]
542#[derive(Debug, Clone, Serialize, Deserialize)]
543#[serde(untagged)]
544pub enum GetForkCreationStatusError {
545    UnknownValue(serde_json::Value),
546}
547
548/// struct for typed errors of method [`get_git_sync_deploy_mode`]
549#[derive(Debug, Clone, Serialize, Deserialize)]
550#[serde(untagged)]
551pub enum GetGitSyncDeployModeError {
552    UnknownValue(serde_json::Value),
553}
554
555/// struct for typed errors of method [`get_git_sync_enabled`]
556#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(untagged)]
558pub enum GetGitSyncEnabledError {
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`get_github_app_repo_archive`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum GetGithubAppRepoArchiveError {
566    UnknownValue(serde_json::Value),
567}
568
569/// struct for typed errors of method [`get_github_app_token`]
570#[derive(Debug, Clone, Serialize, Deserialize)]
571#[serde(untagged)]
572pub enum GetGithubAppTokenError {
573    UnknownValue(serde_json::Value),
574}
575
576/// struct for typed errors of method [`get_guest_usage`]
577#[derive(Debug, Clone, Serialize, Deserialize)]
578#[serde(untagged)]
579pub enum GetGuestUsageError {
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`get_imports`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum GetImportsError {
587    UnknownValue(serde_json::Value),
588}
589
590/// struct for typed errors of method [`get_is_premium`]
591#[derive(Debug, Clone, Serialize, Deserialize)]
592#[serde(untagged)]
593pub enum GetIsPremiumError {
594    UnknownValue(serde_json::Value),
595}
596
597/// struct for typed errors of method [`get_open_deployment_request`]
598#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum GetOpenDeploymentRequestError {
601    UnknownValue(serde_json::Value),
602}
603
604/// struct for typed errors of method [`get_premium_info`]
605#[derive(Debug, Clone, Serialize, Deserialize)]
606#[serde(untagged)]
607pub enum GetPremiumInfoError {
608    UnknownValue(serde_json::Value),
609}
610
611/// struct for typed errors of method [`get_public_settings`]
612#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(untagged)]
614pub enum GetPublicSettingsError {
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`get_remote_deploy_target`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum GetRemoteDeployTargetError {
622    UnknownValue(serde_json::Value),
623}
624
625/// struct for typed errors of method [`get_session_workspace_retention`]
626#[derive(Debug, Clone, Serialize, Deserialize)]
627#[serde(untagged)]
628pub enum GetSessionWorkspaceRetentionError {
629    UnknownValue(serde_json::Value),
630}
631
632/// struct for typed errors of method [`get_session_workspace_status`]
633#[derive(Debug, Clone, Serialize, Deserialize)]
634#[serde(untagged)]
635pub enum GetSessionWorkspaceStatusError {
636    UnknownValue(serde_json::Value),
637}
638
639/// struct for typed errors of method [`get_settings`]
640#[derive(Debug, Clone, Serialize, Deserialize)]
641#[serde(untagged)]
642pub enum GetSettingsError {
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`get_shared_ui`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum GetSharedUiError {
650    UnknownValue(serde_json::Value),
651}
652
653/// struct for typed errors of method [`get_shared_ui_version`]
654#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum GetSharedUiVersionError {
657    UnknownValue(serde_json::Value),
658}
659
660/// struct for typed errors of method [`get_threshold_alert`]
661#[derive(Debug, Clone, Serialize, Deserialize)]
662#[serde(untagged)]
663pub enum GetThresholdAlertError {
664    UnknownValue(serde_json::Value),
665}
666
667/// struct for typed errors of method [`get_used_triggers`]
668#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum GetUsedTriggersError {
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`get_workspace_as_super_admin`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum GetWorkspaceAsSuperAdminError {
678    UnknownValue(serde_json::Value),
679}
680
681/// struct for typed errors of method [`get_workspace_default_app`]
682#[derive(Debug, Clone, Serialize, Deserialize)]
683#[serde(untagged)]
684pub enum GetWorkspaceDefaultAppError {
685    UnknownValue(serde_json::Value),
686}
687
688/// struct for typed errors of method [`get_workspace_encryption_key`]
689#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(untagged)]
691pub enum GetWorkspaceEncryptionKeyError {
692    UnknownValue(serde_json::Value),
693}
694
695/// struct for typed errors of method [`get_workspace_name`]
696#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum GetWorkspaceNameError {
699    UnknownValue(serde_json::Value),
700}
701
702/// struct for typed errors of method [`get_workspace_settings_document`]
703#[derive(Debug, Clone, Serialize, Deserialize)]
704#[serde(untagged)]
705pub enum GetWorkspaceSettingsDocumentError {
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`get_workspace_slack_oauth_config`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum GetWorkspaceSlackOauthConfigError {
713    UnknownValue(serde_json::Value),
714}
715
716/// struct for typed errors of method [`get_workspace_usage`]
717#[derive(Debug, Clone, Serialize, Deserialize)]
718#[serde(untagged)]
719pub enum GetWorkspaceUsageError {
720    UnknownValue(serde_json::Value),
721}
722
723/// struct for typed errors of method [`import_pg_database`]
724#[derive(Debug, Clone, Serialize, Deserialize)]
725#[serde(untagged)]
726pub enum ImportPgDatabaseError {
727    UnknownValue(serde_json::Value),
728}
729
730/// struct for typed errors of method [`invite_user`]
731#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum InviteUserError {
734    UnknownValue(serde_json::Value),
735}
736
737/// struct for typed errors of method [`is_domain_allowed`]
738#[derive(Debug, Clone, Serialize, Deserialize)]
739#[serde(untagged)]
740pub enum IsDomainAllowedError {
741    UnknownValue(serde_json::Value),
742}
743
744/// struct for typed errors of method [`leave_workspace`]
745#[derive(Debug, Clone, Serialize, Deserialize)]
746#[serde(untagged)]
747pub enum LeaveWorkspaceError {
748    UnknownValue(serde_json::Value),
749}
750
751/// struct for typed errors of method [`list_available_teams_channels`]
752#[derive(Debug, Clone, Serialize, Deserialize)]
753#[serde(untagged)]
754pub enum ListAvailableTeamsChannelsError {
755    UnknownValue(serde_json::Value),
756}
757
758/// struct for typed errors of method [`list_available_teams_ids`]
759#[derive(Debug, Clone, Serialize, Deserialize)]
760#[serde(untagged)]
761pub enum ListAvailableTeamsIdsError {
762    UnknownValue(serde_json::Value),
763}
764
765/// struct for typed errors of method [`list_data_table_schemas`]
766#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum ListDataTableSchemasError {
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`list_data_table_tables`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum ListDataTableTablesError {
776    UnknownValue(serde_json::Value),
777}
778
779/// struct for typed errors of method [`list_data_tables`]
780#[derive(Debug, Clone, Serialize, Deserialize)]
781#[serde(untagged)]
782pub enum ListDataTablesError {
783    UnknownValue(serde_json::Value),
784}
785
786/// struct for typed errors of method [`list_datatable_migrations`]
787#[derive(Debug, Clone, Serialize, Deserialize)]
788#[serde(untagged)]
789pub enum ListDatatableMigrationsError {
790    UnknownValue(serde_json::Value),
791}
792
793/// struct for typed errors of method [`list_deployment_request_eligible_deployers`]
794#[derive(Debug, Clone, Serialize, Deserialize)]
795#[serde(untagged)]
796pub enum ListDeploymentRequestEligibleDeployersError {
797    UnknownValue(serde_json::Value),
798}
799
800/// struct for typed errors of method [`list_ducklakes`]
801#[derive(Debug, Clone, Serialize, Deserialize)]
802#[serde(untagged)]
803pub enum ListDucklakesError {
804    UnknownValue(serde_json::Value),
805}
806
807/// struct for typed errors of method [`list_password_login_members`]
808#[derive(Debug, Clone, Serialize, Deserialize)]
809#[serde(untagged)]
810pub enum ListPasswordLoginMembersError {
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/// 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. 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.
2395pub async fn edit_guest_jwt_key(configuration: &configuration::Configuration, workspace: &str, edit_guest_jwt_key_request: models::EditGuestJwtKeyRequest) -> Result<String, Error<EditGuestJwtKeyError>> {
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_jwt_key", 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_jwt_key_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<EditGuestJwtKeyError> = 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
2426pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
2427    let local_var_configuration = configuration;
2428
2429    let local_var_client = &local_var_configuration.client;
2430
2431    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2432    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2433
2434    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2435        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2436    }
2437    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2438        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2439    };
2440    local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
2441
2442    let local_var_req = local_var_req_builder.build()?;
2443    let local_var_resp = local_var_client.execute(local_var_req).await?;
2444
2445    let local_var_status = local_var_resp.status();
2446    let local_var_content = local_var_resp.text().await?;
2447
2448    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2449        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2450    } else {
2451        let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2452        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2453        Err(Error::ResponseError(local_var_error))
2454    }
2455}
2456
2457pub 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>> {
2458    let local_var_configuration = configuration;
2459
2460    let local_var_client = &local_var_configuration.client;
2461
2462    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2463    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2464
2465    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2466        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2467    }
2468    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2469        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2470    };
2471    local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
2472
2473    let local_var_req = local_var_req_builder.build()?;
2474    let local_var_resp = local_var_client.execute(local_var_req).await?;
2475
2476    let local_var_status = local_var_resp.status();
2477    let local_var_content = local_var_resp.text().await?;
2478
2479    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2480        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2481    } else {
2482        let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2483        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2484        Err(Error::ResponseError(local_var_error))
2485    }
2486}
2487
2488pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
2489    let local_var_configuration = configuration;
2490
2491    let local_var_client = &local_var_configuration.client;
2492
2493    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2494    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2495
2496    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2497        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2498    }
2499    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2500        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2501    };
2502    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
2503
2504    let local_var_req = local_var_req_builder.build()?;
2505    let local_var_resp = local_var_client.execute(local_var_req).await?;
2506
2507    let local_var_status = local_var_resp.status();
2508    let local_var_content = local_var_resp.text().await?;
2509
2510    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2511        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2512    } else {
2513        let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2514        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2515        Err(Error::ResponseError(local_var_error))
2516    }
2517}
2518
2519pub async fn edit_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler: models::EditSuccessHandler) -> Result<String, Error<EditSuccessHandlerError>> {
2520    let local_var_configuration = configuration;
2521
2522    let local_var_client = &local_var_configuration.client;
2523
2524    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_success_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2525    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2526
2527    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2528        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2529    }
2530    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2531        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2532    };
2533    local_var_req_builder = local_var_req_builder.json(&edit_success_handler);
2534
2535    let local_var_req = local_var_req_builder.build()?;
2536    let local_var_resp = local_var_client.execute(local_var_req).await?;
2537
2538    let local_var_status = local_var_resp.status();
2539    let local_var_content = local_var_resp.text().await?;
2540
2541    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2542        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2543    } else {
2544        let local_var_entity: Option<EditSuccessHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2545        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2546        Err(Error::ResponseError(local_var_error))
2547    }
2548}
2549
2550pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
2551    let local_var_configuration = configuration;
2552
2553    let local_var_client = &local_var_configuration.client;
2554
2555    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2556    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2557
2558    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2559        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2560    }
2561    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2562        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2563    };
2564    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
2565
2566    let local_var_req = local_var_req_builder.build()?;
2567    let local_var_resp = local_var_client.execute(local_var_req).await?;
2568
2569    let local_var_status = local_var_resp.status();
2570    let local_var_content = local_var_resp.text().await?;
2571
2572    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2573        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2574    } else {
2575        let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2576        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2577        Err(Error::ResponseError(local_var_error))
2578    }
2579}
2580
2581pub async fn edit_variable_expiration_handler(configuration: &configuration::Configuration, workspace: &str, edit_variable_expiration_handler: models::EditVariableExpirationHandler) -> Result<String, Error<EditVariableExpirationHandlerError>> {
2582    let local_var_configuration = configuration;
2583
2584    let local_var_client = &local_var_configuration.client;
2585
2586    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_variable_expiration_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2587    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2588
2589    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2590        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2591    }
2592    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2593        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2594    };
2595    local_var_req_builder = local_var_req_builder.json(&edit_variable_expiration_handler);
2596
2597    let local_var_req = local_var_req_builder.build()?;
2598    let local_var_resp = local_var_client.execute(local_var_req).await?;
2599
2600    let local_var_status = local_var_resp.status();
2601    let local_var_content = local_var_resp.text().await?;
2602
2603    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2604        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2605    } else {
2606        let local_var_entity: Option<EditVariableExpirationHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2607        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2608        Err(Error::ResponseError(local_var_error))
2609    }
2610}
2611
2612pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
2613    let local_var_configuration = configuration;
2614
2615    let local_var_client = &local_var_configuration.client;
2616
2617    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2618    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2619
2620    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2621        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2622    }
2623    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2624        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2625    };
2626    local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
2627
2628    let local_var_req = local_var_req_builder.build()?;
2629    let local_var_resp = local_var_client.execute(local_var_req).await?;
2630
2631    let local_var_status = local_var_resp.status();
2632    let local_var_content = local_var_resp.text().await?;
2633
2634    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2635        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2636    } else {
2637        let local_var_entity: Option<EditWebhookError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2638        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2639        Err(Error::ResponseError(local_var_error))
2640    }
2641}
2642
2643pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
2644    let local_var_configuration = configuration;
2645
2646    let local_var_client = &local_var_configuration.client;
2647
2648    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2649    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2650
2651    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2652        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2653    }
2654    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2655        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2656    };
2657    local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
2658
2659    let local_var_req = local_var_req_builder.build()?;
2660    let local_var_resp = local_var_client.execute(local_var_req).await?;
2661
2662    let local_var_status = local_var_resp.status();
2663    let local_var_content = local_var_resp.text().await?;
2664
2665    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2666        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2667    } else {
2668        let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2669        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2670        Err(Error::ResponseError(local_var_error))
2671    }
2672}
2673
2674pub 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>> {
2675    let local_var_configuration = configuration;
2676
2677    let local_var_client = &local_var_configuration.client;
2678
2679    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2680    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2681
2682    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2683        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2684    }
2685    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2686        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2687    };
2688    local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
2689
2690    let local_var_req = local_var_req_builder.build()?;
2691    let local_var_resp = local_var_client.execute(local_var_req).await?;
2692
2693    let local_var_status = local_var_resp.status();
2694    let local_var_content = local_var_resp.text().await?;
2695
2696    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2697        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2698    } else {
2699        let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2700        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2701        Err(Error::ResponseError(local_var_error))
2702    }
2703}
2704
2705pub 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>> {
2706    let local_var_configuration = configuration;
2707
2708    let local_var_client = &local_var_configuration.client;
2709
2710    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2711    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2712
2713    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2714        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2715    }
2716    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2717        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2718    };
2719    local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
2720
2721    let local_var_req = local_var_req_builder.build()?;
2722    let local_var_resp = local_var_client.execute(local_var_req).await?;
2723
2724    let local_var_status = local_var_resp.status();
2725    let local_var_content = local_var_resp.text().await?;
2726
2727    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2728        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2729    } else {
2730        let local_var_entity: Option<EditWorkspaceGitSyncConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2731        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2732        Err(Error::ResponseError(local_var_error))
2733    }
2734}
2735
2736pub async fn enable_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<String, Error<EnableDatatableMigrationsError>> {
2737    let local_var_configuration = configuration;
2738
2739    let local_var_client = &local_var_configuration.client;
2740
2741    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));
2742    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2743
2744    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2745        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2746    }
2747    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2748        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2749    };
2750
2751    let local_var_req = local_var_req_builder.build()?;
2752    let local_var_resp = local_var_client.execute(local_var_req).await?;
2753
2754    let local_var_status = local_var_resp.status();
2755    let local_var_content = local_var_resp.text().await?;
2756
2757    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2758        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2759    } else {
2760        let local_var_entity: Option<EnableDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2761        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2762        Err(Error::ResponseError(local_var_error))
2763    }
2764}
2765
2766pub async fn exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
2767    let local_var_configuration = configuration;
2768
2769    let local_var_client = &local_var_configuration.client;
2770
2771    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
2772    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2773
2774    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2775        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2776    }
2777    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2778        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2779    };
2780    local_var_req_builder = local_var_req_builder.json(&exists_username_request);
2781
2782    let local_var_req = local_var_req_builder.build()?;
2783    let local_var_resp = local_var_client.execute(local_var_req).await?;
2784
2785    let local_var_status = local_var_resp.status();
2786    let local_var_content = local_var_resp.text().await?;
2787
2788    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2789        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2790    } else {
2791        let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2792        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2793        Err(Error::ResponseError(local_var_error))
2794    }
2795}
2796
2797pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
2798    let local_var_configuration = configuration;
2799
2800    let local_var_client = &local_var_configuration.client;
2801
2802    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
2803    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2804
2805    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2806        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2807    }
2808    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2809        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2810    };
2811    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
2812
2813    let local_var_req = local_var_req_builder.build()?;
2814    let local_var_resp = local_var_client.execute(local_var_req).await?;
2815
2816    let local_var_status = local_var_resp.status();
2817    let local_var_content = local_var_resp.text().await?;
2818
2819    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2820        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2821    } else {
2822        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2823        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2824        Err(Error::ResponseError(local_var_error))
2825    }
2826}
2827
2828pub async fn export_pg_schema(configuration: &configuration::Configuration, workspace: &str, export_pg_schema_request: models::ExportPgSchemaRequest) -> Result<String, Error<ExportPgSchemaError>> {
2829    let local_var_configuration = configuration;
2830
2831    let local_var_client = &local_var_configuration.client;
2832
2833    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/export_pg_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2834    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2835
2836    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2837        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2838    }
2839    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2840        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2841    };
2842    local_var_req_builder = local_var_req_builder.json(&export_pg_schema_request);
2843
2844    let local_var_req = local_var_req_builder.build()?;
2845    let local_var_resp = local_var_client.execute(local_var_req).await?;
2846
2847    let local_var_status = local_var_resp.status();
2848    let local_var_content = local_var_resp.text().await?;
2849
2850    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2851        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2852    } else {
2853        let local_var_entity: Option<ExportPgSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2854        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2855        Err(Error::ResponseError(local_var_error))
2856    }
2857}
2858
2859pub async fn generate_initial_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::DatatableMigration, Error<GenerateInitialDatatableMigrationError>> {
2860    let local_var_configuration = configuration;
2861
2862    let local_var_client = &local_var_configuration.client;
2863
2864    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));
2865    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2866
2867    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2868        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2869    }
2870    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2871        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2872    };
2873
2874    let local_var_req = local_var_req_builder.build()?;
2875    let local_var_resp = local_var_client.execute(local_var_req).await?;
2876
2877    let local_var_status = local_var_resp.status();
2878    let local_var_content = local_var_resp.text().await?;
2879
2880    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2881        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2882    } else {
2883        let local_var_entity: Option<GenerateInitialDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2884        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2885        Err(Error::ResponseError(local_var_error))
2886    }
2887}
2888
2889pub async fn get_billable_seats(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetBillableSeats200Response, Error<GetBillableSeatsError>> {
2890    let local_var_configuration = configuration;
2891
2892    let local_var_client = &local_var_configuration.client;
2893
2894    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/billable_seats", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2895    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2896
2897    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2898        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2899    }
2900    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2901        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2902    };
2903
2904    let local_var_req = local_var_req_builder.build()?;
2905    let local_var_resp = local_var_client.execute(local_var_req).await?;
2906
2907    let local_var_status = local_var_resp.status();
2908    let local_var_content = local_var_resp.text().await?;
2909
2910    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2911        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2912    } else {
2913        let local_var_entity: Option<GetBillableSeatsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2914        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2915        Err(Error::ResponseError(local_var_error))
2916    }
2917}
2918
2919pub async fn get_cloud_quotas(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCloudQuotas200Response, Error<GetCloudQuotasError>> {
2920    let local_var_configuration = configuration;
2921
2922    let local_var_client = &local_var_configuration.client;
2923
2924    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/cloud_quotas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2925    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2926
2927    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2928        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2929    }
2930    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2931        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2932    };
2933
2934    let local_var_req = local_var_req_builder.build()?;
2935    let local_var_resp = local_var_client.execute(local_var_req).await?;
2936
2937    let local_var_status = local_var_resp.status();
2938    let local_var_content = local_var_resp.text().await?;
2939
2940    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2941        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2942    } else {
2943        let local_var_entity: Option<GetCloudQuotasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2944        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2945        Err(Error::ResponseError(local_var_error))
2946    }
2947}
2948
2949pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
2950    let local_var_configuration = configuration;
2951
2952    let local_var_client = &local_var_configuration.client;
2953
2954    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2955    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2956
2957    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2958        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2959    }
2960    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2961        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2962    };
2963
2964    let local_var_req = local_var_req_builder.build()?;
2965    let local_var_resp = local_var_client.execute(local_var_req).await?;
2966
2967    let local_var_status = local_var_resp.status();
2968    let local_var_content = local_var_resp.text().await?;
2969
2970    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2971        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2972    } else {
2973        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2974        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2975        Err(Error::ResponseError(local_var_error))
2976    }
2977}
2978
2979pub async fn get_copilot_settings_state(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCopilotSettingsState200Response, Error<GetCopilotSettingsStateError>> {
2980    let local_var_configuration = configuration;
2981
2982    let local_var_client = &local_var_configuration.client;
2983
2984    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_settings_state", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2985    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2986
2987    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2988        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2989    }
2990    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2991        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2992    };
2993
2994    let local_var_req = local_var_req_builder.build()?;
2995    let local_var_resp = local_var_client.execute(local_var_req).await?;
2996
2997    let local_var_status = local_var_resp.status();
2998    let local_var_content = local_var_resp.text().await?;
2999
3000    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3001        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3002    } else {
3003        let local_var_entity: Option<GetCopilotSettingsStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3004        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3005        Err(Error::ResponseError(local_var_error))
3006    }
3007}
3008
3009pub async fn get_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>> {
3010    let local_var_configuration = configuration;
3011
3012    let local_var_client = &local_var_configuration.client;
3013
3014    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_table_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3015    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3016
3017    local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &datatable_name.to_string())]);
3018    local_var_req_builder = local_var_req_builder.query(&[("schema_name", &schema_name.to_string())]);
3019    local_var_req_builder = local_var_req_builder.query(&[("table_name", &table_name.to_string())]);
3020    if let Some(ref local_var_str) = role {
3021        local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
3022    }
3023    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3024        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3025    }
3026    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3027        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3028    };
3029
3030    let local_var_req = local_var_req_builder.build()?;
3031    let local_var_resp = local_var_client.execute(local_var_req).await?;
3032
3033    let local_var_status = local_var_resp.status();
3034    let local_var_content = local_var_resp.text().await?;
3035
3036    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3037        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3038    } else {
3039        let local_var_entity: Option<GetDataTableTableSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3040        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3041        Err(Error::ResponseError(local_var_error))
3042    }
3043}
3044
3045pub 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>> {
3046    let local_var_configuration = configuration;
3047
3048    let local_var_client = &local_var_configuration.client;
3049
3050    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));
3051    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3052
3053    local_var_req_builder = local_var_req_builder.query(&[("kind", &kind.to_string())]);
3054    if let Some(ref local_var_str) = schema {
3055        local_var_req_builder = local_var_req_builder.query(&[("schema", &local_var_str.to_string())]);
3056    }
3057    if let Some(ref local_var_str) = table {
3058        local_var_req_builder = local_var_req_builder.query(&[("table", &local_var_str.to_string())]);
3059    }
3060    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3061        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3062    }
3063    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3064        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3065    };
3066
3067    let local_var_req = local_var_req_builder.build()?;
3068    let local_var_resp = local_var_client.execute(local_var_req).await?;
3069
3070    let local_var_status = local_var_resp.status();
3071    let local_var_content = local_var_resp.text().await?;
3072
3073    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3074        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3075    } else {
3076        let local_var_entity: Option<GetDatatableAclError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3077        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3078        Err(Error::ResponseError(local_var_error))
3079    }
3080}
3081
3082pub 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>> {
3083    let local_var_configuration = configuration;
3084
3085    let local_var_client = &local_var_configuration.client;
3086
3087    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_full_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3088    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3089
3090    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3091        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3092    }
3093    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3094        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3095    };
3096    local_var_req_builder = local_var_req_builder.json(&get_datatable_full_schema_request);
3097
3098    let local_var_req = local_var_req_builder.build()?;
3099    let local_var_resp = local_var_client.execute(local_var_req).await?;
3100
3101    let local_var_status = local_var_resp.status();
3102    let local_var_content = local_var_resp.text().await?;
3103
3104    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3105        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3106    } else {
3107        let local_var_entity: Option<GetDatatableFullSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3108        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3109        Err(Error::ResponseError(local_var_error))
3110    }
3111}
3112
3113pub async fn get_datatable_migrations_status(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::GetDatatableMigrationsStatus200Response, Error<GetDatatableMigrationsStatusError>> {
3114    let local_var_configuration = configuration;
3115
3116    let local_var_client = &local_var_configuration.client;
3117
3118    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));
3119    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3120
3121    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3122        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3123    }
3124    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3125        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3126    };
3127
3128    let local_var_req = local_var_req_builder.build()?;
3129    let local_var_resp = local_var_client.execute(local_var_req).await?;
3130
3131    let local_var_status = local_var_resp.status();
3132    let local_var_content = local_var_resp.text().await?;
3133
3134    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3135        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3136    } else {
3137        let local_var_entity: Option<GetDatatableMigrationsStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3138        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3139        Err(Error::ResponseError(local_var_error))
3140    }
3141}
3142
3143pub async fn get_datatable_permissions(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::DatatablePermissions, Error<GetDatatablePermissionsError>> {
3144    let local_var_configuration = configuration;
3145
3146    let local_var_client = &local_var_configuration.client;
3147
3148    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));
3149    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3150
3151    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3152        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3153    }
3154    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3155        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3156    };
3157
3158    let local_var_req = local_var_req_builder.build()?;
3159    let local_var_resp = local_var_client.execute(local_var_req).await?;
3160
3161    let local_var_status = local_var_resp.status();
3162    let local_var_content = local_var_resp.text().await?;
3163
3164    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3165        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3166    } else {
3167        let local_var_entity: Option<GetDatatablePermissionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3168        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3169        Err(Error::ResponseError(local_var_error))
3170    }
3171}
3172
3173pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
3174    let local_var_configuration = configuration;
3175
3176    let local_var_client = &local_var_configuration.client;
3177
3178    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3179    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3180
3181    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3182        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3183    }
3184    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3185        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3186    };
3187
3188    let local_var_req = local_var_req_builder.build()?;
3189    let local_var_resp = local_var_client.execute(local_var_req).await?;
3190
3191    let local_var_status = local_var_resp.status();
3192    let local_var_content = local_var_resp.text().await?;
3193
3194    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3195        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3196    } else {
3197        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3198        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3199        Err(Error::ResponseError(local_var_error))
3200    }
3201}
3202
3203pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
3204    let local_var_configuration = configuration;
3205
3206    let local_var_client = &local_var_configuration.client;
3207
3208    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3209    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3210
3211    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3212        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3213    }
3214    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3215        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3216    };
3217
3218    let local_var_req = local_var_req_builder.build()?;
3219    let local_var_resp = local_var_client.execute(local_var_req).await?;
3220
3221    let local_var_status = local_var_resp.status();
3222    let local_var_content = local_var_resp.text().await?;
3223
3224    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3225        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3226    } else {
3227        let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3228        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3229        Err(Error::ResponseError(local_var_error))
3230    }
3231}
3232
3233pub async fn get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
3234    let local_var_configuration = configuration;
3235
3236    let local_var_client = &local_var_configuration.client;
3237
3238    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));
3239    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3240
3241    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3242        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3243    }
3244    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3245        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3246    };
3247
3248    let local_var_req = local_var_req_builder.build()?;
3249    let local_var_resp = local_var_client.execute(local_var_req).await?;
3250
3251    let local_var_status = local_var_resp.status();
3252    let local_var_content = local_var_resp.text().await?;
3253
3254    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3255        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3256    } else {
3257        let local_var_entity: Option<GetDependentsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3258        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3259        Err(Error::ResponseError(local_var_error))
3260    }
3261}
3262
3263pub async fn get_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
3264    let local_var_configuration = configuration;
3265
3266    let local_var_client = &local_var_configuration.client;
3267
3268    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3269    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3270
3271    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3272        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3273    }
3274    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3275        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3276    };
3277    local_var_req_builder = local_var_req_builder.json(&request_body);
3278
3279    let local_var_req = local_var_req_builder.build()?;
3280    let local_var_resp = local_var_client.execute(local_var_req).await?;
3281
3282    let local_var_status = local_var_resp.status();
3283    let local_var_content = local_var_resp.text().await?;
3284
3285    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3286        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3287    } else {
3288        let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3289        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3290        Err(Error::ResponseError(local_var_error))
3291    }
3292}
3293
3294pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
3295    let local_var_configuration = configuration;
3296
3297    let local_var_client = &local_var_configuration.client;
3298
3299    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3300    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3301
3302    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3303        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3304    }
3305    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3306        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3307    };
3308
3309    let local_var_req = local_var_req_builder.build()?;
3310    let local_var_resp = local_var_client.execute(local_var_req).await?;
3311
3312    let local_var_status = local_var_resp.status();
3313    let local_var_content = local_var_resp.text().await?;
3314
3315    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3316        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3317    } else {
3318        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3319        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3320        Err(Error::ResponseError(local_var_error))
3321    }
3322}
3323
3324pub async fn get_dev_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDevWorkspace200Response, Error<GetDevWorkspaceError>> {
3325    let local_var_configuration = configuration;
3326
3327    let local_var_client = &local_var_configuration.client;
3328
3329    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dev_workspace", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3330    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3331
3332    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3333        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3334    }
3335    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3336        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3337    };
3338
3339    let local_var_req = local_var_req_builder.build()?;
3340    let local_var_resp = local_var_client.execute(local_var_req).await?;
3341
3342    let local_var_status = local_var_resp.status();
3343    let local_var_content = local_var_resp.text().await?;
3344
3345    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3346        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3347    } else {
3348        let local_var_entity: Option<GetDevWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3349        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3350        Err(Error::ResponseError(local_var_error))
3351    }
3352}
3353
3354pub async fn get_fork_creation_status(configuration: &configuration::Configuration, workspace: &str, creation_id: &str) -> Result<models::GetForkCreationStatus200Response, Error<GetForkCreationStatusError>> {
3355    let local_var_configuration = configuration;
3356
3357    let local_var_client = &local_var_configuration.client;
3358
3359    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));
3360    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3361
3362    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3363        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3364    }
3365    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3366        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3367    };
3368
3369    let local_var_req = local_var_req_builder.build()?;
3370    let local_var_resp = local_var_client.execute(local_var_req).await?;
3371
3372    let local_var_status = local_var_resp.status();
3373    let local_var_content = local_var_resp.text().await?;
3374
3375    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3376        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3377    } else {
3378        let local_var_entity: Option<GetForkCreationStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3379        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3380        Err(Error::ResponseError(local_var_error))
3381    }
3382}
3383
3384pub async fn get_git_sync_deploy_mode(configuration: &configuration::Configuration, workspace: &str, branch: Option<&str>) -> Result<models::GetGitSyncDeployMode200Response, Error<GetGitSyncDeployModeError>> {
3385    let local_var_configuration = configuration;
3386
3387    let local_var_client = &local_var_configuration.client;
3388
3389    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_deploy_mode", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3390    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3391
3392    if let Some(ref local_var_str) = branch {
3393        local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]);
3394    }
3395    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3396        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3397    }
3398    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3399        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3400    };
3401
3402    let local_var_req = local_var_req_builder.build()?;
3403    let local_var_resp = local_var_client.execute(local_var_req).await?;
3404
3405    let local_var_status = local_var_resp.status();
3406    let local_var_content = local_var_resp.text().await?;
3407
3408    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3409        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3410    } else {
3411        let local_var_entity: Option<GetGitSyncDeployModeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3412        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3413        Err(Error::ResponseError(local_var_error))
3414    }
3415}
3416
3417pub async fn get_git_sync_enabled(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetGitSyncEnabled200Response, Error<GetGitSyncEnabledError>> {
3418    let local_var_configuration = configuration;
3419
3420    let local_var_client = &local_var_configuration.client;
3421
3422    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_enabled", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3423    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3424
3425    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3426        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3427    }
3428    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3429        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3430    };
3431
3432    let local_var_req = local_var_req_builder.build()?;
3433    let local_var_resp = local_var_client.execute(local_var_req).await?;
3434
3435    let local_var_status = local_var_resp.status();
3436    let local_var_content = local_var_resp.text().await?;
3437
3438    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3439        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3440    } else {
3441        let local_var_entity: Option<GetGitSyncEnabledError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3442        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3443        Err(Error::ResponseError(local_var_error))
3444    }
3445}
3446
3447pub async fn get_github_app_repo_archive(configuration: &configuration::Configuration, workspace: &str, path: &str, r#ref: Option<&str>) -> Result<std::path::PathBuf, Error<GetGithubAppRepoArchiveError>> {
3448    let local_var_configuration = configuration;
3449
3450    let local_var_client = &local_var_configuration.client;
3451
3452    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));
3453    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3454
3455    if let Some(ref local_var_str) = r#ref {
3456        local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
3457    }
3458    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3459        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3460    }
3461    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3462        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3463    };
3464
3465    let local_var_req = local_var_req_builder.build()?;
3466    let local_var_resp = local_var_client.execute(local_var_req).await?;
3467
3468    let local_var_status = local_var_resp.status();
3469    let local_var_content = local_var_resp.text().await?;
3470
3471    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3472        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3473    } else {
3474        let local_var_entity: Option<GetGithubAppRepoArchiveError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3475        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3476        Err(Error::ResponseError(local_var_error))
3477    }
3478}
3479
3480pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
3481    let local_var_configuration = configuration;
3482
3483    let local_var_client = &local_var_configuration.client;
3484
3485    let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3486    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3487
3488    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3489        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3490    }
3491    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3492        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3493    };
3494    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
3495
3496    let local_var_req = local_var_req_builder.build()?;
3497    let local_var_resp = local_var_client.execute(local_var_req).await?;
3498
3499    let local_var_status = local_var_resp.status();
3500    let local_var_content = local_var_resp.text().await?;
3501
3502    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3503        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3504    } else {
3505        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3506        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3507        Err(Error::ResponseError(local_var_error))
3508    }
3509}
3510
3511/// 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.
3512pub async fn get_guest_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GuestUsage, Error<GetGuestUsageError>> {
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}/workspaces/guest_usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3518    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
3527    let local_var_req = local_var_req_builder.build()?;
3528    let local_var_resp = local_var_client.execute(local_var_req).await?;
3529
3530    let local_var_status = local_var_resp.status();
3531    let local_var_content = local_var_resp.text().await?;
3532
3533    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3534        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3535    } else {
3536        let local_var_entity: Option<GetGuestUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3537        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3538        Err(Error::ResponseError(local_var_error))
3539    }
3540}
3541
3542pub async fn get_imports(configuration: &configuration::Configuration, workspace: &str, importer_path: &str) -> Result<Vec<String>, Error<GetImportsError>> {
3543    let local_var_configuration = configuration;
3544
3545    let local_var_client = &local_var_configuration.client;
3546
3547    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));
3548    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3549
3550    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3551        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3552    }
3553    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3554        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3555    };
3556
3557    let local_var_req = local_var_req_builder.build()?;
3558    let local_var_resp = local_var_client.execute(local_var_req).await?;
3559
3560    let local_var_status = local_var_resp.status();
3561    let local_var_content = local_var_resp.text().await?;
3562
3563    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3564        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3565    } else {
3566        let local_var_entity: Option<GetImportsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3567        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3568        Err(Error::ResponseError(local_var_error))
3569    }
3570}
3571
3572pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
3573    let local_var_configuration = configuration;
3574
3575    let local_var_client = &local_var_configuration.client;
3576
3577    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3578    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3579
3580    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3581        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3582    }
3583    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3584        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3585    };
3586
3587    let local_var_req = local_var_req_builder.build()?;
3588    let local_var_resp = local_var_client.execute(local_var_req).await?;
3589
3590    let local_var_status = local_var_resp.status();
3591    let local_var_content = local_var_resp.text().await?;
3592
3593    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3594        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3595    } else {
3596        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3597        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3598        Err(Error::ResponseError(local_var_error))
3599    }
3600}
3601
3602pub async fn get_open_deployment_request(configuration: &configuration::Configuration, workspace: &str) -> Result<models::DeploymentRequest, Error<GetOpenDeploymentRequestError>> {
3603    let local_var_configuration = configuration;
3604
3605    let local_var_client = &local_var_configuration.client;
3606
3607    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/open", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3608    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3609
3610    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3611        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3612    }
3613    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3614        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3615    };
3616
3617    let local_var_req = local_var_req_builder.build()?;
3618    let local_var_resp = local_var_client.execute(local_var_req).await?;
3619
3620    let local_var_status = local_var_resp.status();
3621    let local_var_content = local_var_resp.text().await?;
3622
3623    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3624        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3625    } else {
3626        let local_var_entity: Option<GetOpenDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3627        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3628        Err(Error::ResponseError(local_var_error))
3629    }
3630}
3631
3632pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
3633    let local_var_configuration = configuration;
3634
3635    let local_var_client = &local_var_configuration.client;
3636
3637    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3638    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3639
3640    if let Some(ref local_var_str) = skip_subscription_fetch {
3641        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
3642    }
3643    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3644        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3645    }
3646    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3647        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3648    };
3649
3650    let local_var_req = local_var_req_builder.build()?;
3651    let local_var_resp = local_var_client.execute(local_var_req).await?;
3652
3653    let local_var_status = local_var_resp.status();
3654    let local_var_content = local_var_resp.text().await?;
3655
3656    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3657        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3658    } else {
3659        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3660        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3661        Err(Error::ResponseError(local_var_error))
3662    }
3663}
3664
3665/// Returns the subset of workspace settings safe to expose to any workspace member. The full settings struct is admin-only via `getSettings`.
3666pub async fn get_public_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetPublicSettings200Response, Error<GetPublicSettingsError>> {
3667    let local_var_configuration = configuration;
3668
3669    let local_var_client = &local_var_configuration.client;
3670
3671    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_public_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3672    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3673
3674    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3675        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3676    }
3677    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3678        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3679    };
3680
3681    let local_var_req = local_var_req_builder.build()?;
3682    let local_var_resp = local_var_client.execute(local_var_req).await?;
3683
3684    let local_var_status = local_var_resp.status();
3685    let local_var_content = local_var_resp.text().await?;
3686
3687    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3688        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3689    } else {
3690        let local_var_entity: Option<GetPublicSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3691        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3692        Err(Error::ResponseError(local_var_error))
3693    }
3694}
3695
3696/// 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. 
3697pub async fn get_remote_deploy_target(configuration: &configuration::Configuration, workspace: &str) -> Result<models::RemoteDeployStatus, Error<GetRemoteDeployTargetError>> {
3698    let local_var_configuration = configuration;
3699
3700    let local_var_client = &local_var_configuration.client;
3701
3702    let local_var_uri_str = format!("{}/w/{workspace}/remote_deploy/target", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3703    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3704
3705    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3706        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3707    }
3708    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3709        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3710    };
3711
3712    let local_var_req = local_var_req_builder.build()?;
3713    let local_var_resp = local_var_client.execute(local_var_req).await?;
3714
3715    let local_var_status = local_var_resp.status();
3716    let local_var_content = local_var_resp.text().await?;
3717
3718    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3719        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3720    } else {
3721        let local_var_entity: Option<GetRemoteDeployTargetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3722        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3723        Err(Error::ResponseError(local_var_error))
3724    }
3725}
3726
3727pub async fn get_session_workspace_retention(configuration: &configuration::Configuration, get_session_workspace_status_request: models::GetSessionWorkspaceStatusRequest) -> Result<std::collections::HashMap<String, i32>, Error<GetSessionWorkspaceRetentionError>> {
3728    let local_var_configuration = configuration;
3729
3730    let local_var_client = &local_var_configuration.client;
3731
3732    let local_var_uri_str = format!("{}/workspaces/session_workspace_retention", local_var_configuration.base_path);
3733    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3734
3735    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3736        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3737    }
3738    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3739        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3740    };
3741    local_var_req_builder = local_var_req_builder.json(&get_session_workspace_status_request);
3742
3743    let local_var_req = local_var_req_builder.build()?;
3744    let local_var_resp = local_var_client.execute(local_var_req).await?;
3745
3746    let local_var_status = local_var_resp.status();
3747    let local_var_content = local_var_resp.text().await?;
3748
3749    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3750        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3751    } else {
3752        let local_var_entity: Option<GetSessionWorkspaceRetentionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3753        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3754        Err(Error::ResponseError(local_var_error))
3755    }
3756}
3757
3758pub async fn get_session_workspace_status(configuration: &configuration::Configuration, get_session_workspace_status_request: models::GetSessionWorkspaceStatusRequest) -> Result<std::collections::HashMap<String, String>, Error<GetSessionWorkspaceStatusError>> {
3759    let local_var_configuration = configuration;
3760
3761    let local_var_client = &local_var_configuration.client;
3762
3763    let local_var_uri_str = format!("{}/workspaces/session_workspace_status", local_var_configuration.base_path);
3764    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3765
3766    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3767        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3768    }
3769    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3770        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3771    };
3772    local_var_req_builder = local_var_req_builder.json(&get_session_workspace_status_request);
3773
3774    let local_var_req = local_var_req_builder.build()?;
3775    let local_var_resp = local_var_client.execute(local_var_req).await?;
3776
3777    let local_var_status = local_var_resp.status();
3778    let local_var_content = local_var_resp.text().await?;
3779
3780    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3781        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3782    } else {
3783        let local_var_entity: Option<GetSessionWorkspaceStatusError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3784        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3785        Err(Error::ResponseError(local_var_error))
3786    }
3787}
3788
3789/// Returns the full workspace settings including admin-managed integration credentials. Admin-only — non-admin callers should use `getPublicSettings`.
3790pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
3791    let local_var_configuration = configuration;
3792
3793    let local_var_client = &local_var_configuration.client;
3794
3795    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3796    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
3805    let local_var_req = local_var_req_builder.build()?;
3806    let local_var_resp = local_var_client.execute(local_var_req).await?;
3807
3808    let local_var_status = local_var_resp.status();
3809    let local_var_content = local_var_resp.text().await?;
3810
3811    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3812        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3813    } else {
3814        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3815        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3816        Err(Error::ResponseError(local_var_error))
3817    }
3818}
3819
3820pub async fn get_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUi200Response, Error<GetSharedUiError>> {
3821    let local_var_configuration = configuration;
3822
3823    let local_var_client = &local_var_configuration.client;
3824
3825    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/get", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3826    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3827
3828    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3829        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3830    }
3831    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3832        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3833    };
3834
3835    let local_var_req = local_var_req_builder.build()?;
3836    let local_var_resp = local_var_client.execute(local_var_req).await?;
3837
3838    let local_var_status = local_var_resp.status();
3839    let local_var_content = local_var_resp.text().await?;
3840
3841    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3842        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3843    } else {
3844        let local_var_entity: Option<GetSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3845        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3846        Err(Error::ResponseError(local_var_error))
3847    }
3848}
3849
3850pub async fn get_shared_ui_version(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUiVersion200Response, Error<GetSharedUiVersionError>> {
3851    let local_var_configuration = configuration;
3852
3853    let local_var_client = &local_var_configuration.client;
3854
3855    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/version", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3856    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3857
3858    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3859        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3860    }
3861    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3862        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3863    };
3864
3865    let local_var_req = local_var_req_builder.build()?;
3866    let local_var_resp = local_var_client.execute(local_var_req).await?;
3867
3868    let local_var_status = local_var_resp.status();
3869    let local_var_content = local_var_resp.text().await?;
3870
3871    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3872        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3873    } else {
3874        let local_var_entity: Option<GetSharedUiVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3875        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3876        Err(Error::ResponseError(local_var_error))
3877    }
3878}
3879
3880pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
3881    let local_var_configuration = configuration;
3882
3883    let local_var_client = &local_var_configuration.client;
3884
3885    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3886    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3887
3888    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3889        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3890    }
3891    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3892        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3893    };
3894
3895    let local_var_req = local_var_req_builder.build()?;
3896    let local_var_resp = local_var_client.execute(local_var_req).await?;
3897
3898    let local_var_status = local_var_resp.status();
3899    let local_var_content = local_var_resp.text().await?;
3900
3901    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3902        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3903    } else {
3904        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3905        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3906        Err(Error::ResponseError(local_var_error))
3907    }
3908}
3909
3910pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
3911    let local_var_configuration = configuration;
3912
3913    let local_var_client = &local_var_configuration.client;
3914
3915    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3916    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3917
3918    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3919        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3920    }
3921    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3922        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3923    };
3924
3925    let local_var_req = local_var_req_builder.build()?;
3926    let local_var_resp = local_var_client.execute(local_var_req).await?;
3927
3928    let local_var_status = local_var_resp.status();
3929    let local_var_content = local_var_resp.text().await?;
3930
3931    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3932        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3933    } else {
3934        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3935        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3936        Err(Error::ResponseError(local_var_error))
3937    }
3938}
3939
3940pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
3941    let local_var_configuration = configuration;
3942
3943    let local_var_client = &local_var_configuration.client;
3944
3945    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3946    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3947
3948    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3949        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3950    }
3951    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3952        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3953    };
3954
3955    let local_var_req = local_var_req_builder.build()?;
3956    let local_var_resp = local_var_client.execute(local_var_req).await?;
3957
3958    let local_var_status = local_var_resp.status();
3959    let local_var_content = local_var_resp.text().await?;
3960
3961    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3962        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3963    } else {
3964        let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3965        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3966        Err(Error::ResponseError(local_var_error))
3967    }
3968}
3969
3970pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceDefaultApp200Response, Error<GetWorkspaceDefaultAppError>> {
3971    let local_var_configuration = configuration;
3972
3973    let local_var_client = &local_var_configuration.client;
3974
3975    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3976    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3977
3978    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3979        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3980    }
3981    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3982        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3983    };
3984
3985    let local_var_req = local_var_req_builder.build()?;
3986    let local_var_resp = local_var_client.execute(local_var_req).await?;
3987
3988    let local_var_status = local_var_resp.status();
3989    let local_var_content = local_var_resp.text().await?;
3990
3991    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3992        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3993    } else {
3994        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3995        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3996        Err(Error::ResponseError(local_var_error))
3997    }
3998}
3999
4000pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
4001    let local_var_configuration = configuration;
4002
4003    let local_var_client = &local_var_configuration.client;
4004
4005    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4006    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4007
4008    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4009        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4010    }
4011    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4012        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4013    };
4014
4015    let local_var_req = local_var_req_builder.build()?;
4016    let local_var_resp = local_var_client.execute(local_var_req).await?;
4017
4018    let local_var_status = local_var_resp.status();
4019    let local_var_content = local_var_resp.text().await?;
4020
4021    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4022        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4023    } else {
4024        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4025        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4026        Err(Error::ResponseError(local_var_error))
4027    }
4028}
4029
4030pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
4031    let local_var_configuration = configuration;
4032
4033    let local_var_client = &local_var_configuration.client;
4034
4035    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4036    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4037
4038    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4039        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4040    }
4041    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4042        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4043    };
4044
4045    let local_var_req = local_var_req_builder.build()?;
4046    let local_var_resp = local_var_client.execute(local_var_req).await?;
4047
4048    let local_var_status = local_var_resp.status();
4049    let local_var_content = local_var_resp.text().await?;
4050
4051    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4052        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4053    } else {
4054        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4055        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4056        Err(Error::ResponseError(local_var_error))
4057    }
4058}
4059
4060/// The workspace's settings in the layout of the settings.yaml that `wmill sync` writes. Admin only.
4061pub async fn get_workspace_settings_document(configuration: &configuration::Configuration, workspace: &str, secrets: Option<&str>) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetWorkspaceSettingsDocumentError>> {
4062    let local_var_configuration = configuration;
4063
4064    let local_var_client = &local_var_configuration.client;
4065
4066    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/settings_document", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4067    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4068
4069    if let Some(ref local_var_str) = secrets {
4070        local_var_req_builder = local_var_req_builder.query(&[("secrets", &local_var_str.to_string())]);
4071    }
4072    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4073        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4074    }
4075    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4076        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4077    };
4078
4079    let local_var_req = local_var_req_builder.build()?;
4080    let local_var_resp = local_var_client.execute(local_var_req).await?;
4081
4082    let local_var_status = local_var_resp.status();
4083    let local_var_content = local_var_resp.text().await?;
4084
4085    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4086        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4087    } else {
4088        let local_var_entity: Option<GetWorkspaceSettingsDocumentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4089        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4090        Err(Error::ResponseError(local_var_error))
4091    }
4092}
4093
4094pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
4095    let local_var_configuration = configuration;
4096
4097    let local_var_client = &local_var_configuration.client;
4098
4099    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4100    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4101
4102    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4103        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4104    }
4105    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4106        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4107    };
4108
4109    let local_var_req = local_var_req_builder.build()?;
4110    let local_var_resp = local_var_client.execute(local_var_req).await?;
4111
4112    let local_var_status = local_var_resp.status();
4113    let local_var_content = local_var_resp.text().await?;
4114
4115    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4116        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4117    } else {
4118        let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4119        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4120        Err(Error::ResponseError(local_var_error))
4121    }
4122}
4123
4124pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
4125    let local_var_configuration = configuration;
4126
4127    let local_var_client = &local_var_configuration.client;
4128
4129    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4130    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4131
4132    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4133        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4134    }
4135    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4136        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4137    };
4138
4139    let local_var_req = local_var_req_builder.build()?;
4140    let local_var_resp = local_var_client.execute(local_var_req).await?;
4141
4142    let local_var_status = local_var_resp.status();
4143    let local_var_content = local_var_resp.text().await?;
4144
4145    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4146        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4147    } else {
4148        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4149        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4150        Err(Error::ResponseError(local_var_error))
4151    }
4152}
4153
4154pub async fn import_pg_database(configuration: &configuration::Configuration, workspace: &str, import_pg_database_request: models::ImportPgDatabaseRequest) -> Result<String, Error<ImportPgDatabaseError>> {
4155    let local_var_configuration = configuration;
4156
4157    let local_var_client = &local_var_configuration.client;
4158
4159    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/import_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4160    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4161
4162    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4163        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4164    }
4165    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4166        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4167    };
4168    local_var_req_builder = local_var_req_builder.json(&import_pg_database_request);
4169
4170    let local_var_req = local_var_req_builder.build()?;
4171    let local_var_resp = local_var_client.execute(local_var_req).await?;
4172
4173    let local_var_status = local_var_resp.status();
4174    let local_var_content = local_var_resp.text().await?;
4175
4176    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4177        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4178    } else {
4179        let local_var_entity: Option<ImportPgDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4180        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4181        Err(Error::ResponseError(local_var_error))
4182    }
4183}
4184
4185pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
4186    let local_var_configuration = configuration;
4187
4188    let local_var_client = &local_var_configuration.client;
4189
4190    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4191    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4192
4193    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4194        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4195    }
4196    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4197        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4198    };
4199    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
4200
4201    let local_var_req = local_var_req_builder.build()?;
4202    let local_var_resp = local_var_client.execute(local_var_req).await?;
4203
4204    let local_var_status = local_var_resp.status();
4205    let local_var_content = local_var_resp.text().await?;
4206
4207    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4208        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4209    } else {
4210        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4211        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4212        Err(Error::ResponseError(local_var_error))
4213    }
4214}
4215
4216pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
4217    let local_var_configuration = configuration;
4218
4219    let local_var_client = &local_var_configuration.client;
4220
4221    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
4222    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4223
4224    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4225        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4226    }
4227    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4228        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4229    };
4230
4231    let local_var_req = local_var_req_builder.build()?;
4232    let local_var_resp = local_var_client.execute(local_var_req).await?;
4233
4234    let local_var_status = local_var_resp.status();
4235    let local_var_content = local_var_resp.text().await?;
4236
4237    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4238        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4239    } else {
4240        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4241        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4242        Err(Error::ResponseError(local_var_error))
4243    }
4244}
4245
4246pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
4247    let local_var_configuration = configuration;
4248
4249    let local_var_client = &local_var_configuration.client;
4250
4251    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4252    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4253
4254    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4255        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4256    }
4257    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4258        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4259    };
4260
4261    let local_var_req = local_var_req_builder.build()?;
4262    let local_var_resp = local_var_client.execute(local_var_req).await?;
4263
4264    let local_var_status = local_var_resp.status();
4265    let local_var_content = local_var_resp.text().await?;
4266
4267    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4268        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4269    } else {
4270        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4271        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4272        Err(Error::ResponseError(local_var_error))
4273    }
4274}
4275
4276pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
4277    let local_var_configuration = configuration;
4278
4279    let local_var_client = &local_var_configuration.client;
4280
4281    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4282    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4283
4284    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
4285    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4286        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4287    }
4288    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4289        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4290    };
4291
4292    let local_var_req = local_var_req_builder.build()?;
4293    let local_var_resp = local_var_client.execute(local_var_req).await?;
4294
4295    let local_var_status = local_var_resp.status();
4296    let local_var_content = local_var_resp.text().await?;
4297
4298    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4299        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4300    } else {
4301        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4302        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4303        Err(Error::ResponseError(local_var_error))
4304    }
4305}
4306
4307pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
4308    let local_var_configuration = configuration;
4309
4310    let local_var_client = &local_var_configuration.client;
4311
4312    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4313    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4314
4315    if let Some(ref local_var_str) = search {
4316        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
4317    }
4318    if let Some(ref local_var_str) = next_link {
4319        local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
4320    }
4321    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4322        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4323    }
4324    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4325        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4326    };
4327
4328    let local_var_req = local_var_req_builder.build()?;
4329    let local_var_resp = local_var_client.execute(local_var_req).await?;
4330
4331    let local_var_status = local_var_resp.status();
4332    let local_var_content = local_var_resp.text().await?;
4333
4334    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4335        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4336    } else {
4337        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4338        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4339        Err(Error::ResponseError(local_var_error))
4340    }
4341}
4342
4343pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
4344    let local_var_configuration = configuration;
4345
4346    let local_var_client = &local_var_configuration.client;
4347
4348    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4349    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4350
4351    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4352        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4353    }
4354    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4355        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4356    };
4357
4358    let local_var_req = local_var_req_builder.build()?;
4359    let local_var_resp = local_var_client.execute(local_var_req).await?;
4360
4361    let local_var_status = local_var_resp.status();
4362    let local_var_content = local_var_resp.text().await?;
4363
4364    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4365        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4366    } else {
4367        let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4368        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4369        Err(Error::ResponseError(local_var_error))
4370    }
4371}
4372
4373pub 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>> {
4374    let local_var_configuration = configuration;
4375
4376    let local_var_client = &local_var_configuration.client;
4377
4378    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_tables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4379    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4380
4381    if let Some(ref local_var_str) = datatable_name {
4382        local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &local_var_str.to_string())]);
4383    }
4384    if let Some(ref local_var_str) = role_for {
4385        local_var_req_builder = local_var_req_builder.query(&[("role_for", &local_var_str.to_string())]);
4386    }
4387    if let Some(ref local_var_str) = role {
4388        local_var_req_builder = local_var_req_builder.query(&[("role", &local_var_str.to_string())]);
4389    }
4390    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4391        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4392    }
4393    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4394        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4395    };
4396
4397    let local_var_req = local_var_req_builder.build()?;
4398    let local_var_resp = local_var_client.execute(local_var_req).await?;
4399
4400    let local_var_status = local_var_resp.status();
4401    let local_var_content = local_var_resp.text().await?;
4402
4403    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4404        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4405    } else {
4406        let local_var_entity: Option<ListDataTableTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4407        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4408        Err(Error::ResponseError(local_var_error))
4409    }
4410}
4411
4412pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListDataTables200ResponseInner>, Error<ListDataTablesError>> {
4413    let local_var_configuration = configuration;
4414
4415    let local_var_client = &local_var_configuration.client;
4416
4417    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4418    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4419
4420    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4421        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4422    }
4423    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4424        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4425    };
4426
4427    let local_var_req = local_var_req_builder.build()?;
4428    let local_var_resp = local_var_client.execute(local_var_req).await?;
4429
4430    let local_var_status = local_var_resp.status();
4431    let local_var_content = local_var_resp.text().await?;
4432
4433    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4434        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4435    } else {
4436        let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4437        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4438        Err(Error::ResponseError(local_var_error))
4439    }
4440}
4441
4442pub async fn list_datatable_migrations(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DatatableMigration>, Error<ListDatatableMigrationsError>> {
4443    let local_var_configuration = configuration;
4444
4445    let local_var_client = &local_var_configuration.client;
4446
4447    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_migrations", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4448    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4449
4450    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4451        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4452    }
4453    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4454        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4455    };
4456
4457    let local_var_req = local_var_req_builder.build()?;
4458    let local_var_resp = local_var_client.execute(local_var_req).await?;
4459
4460    let local_var_status = local_var_resp.status();
4461    let local_var_content = local_var_resp.text().await?;
4462
4463    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4464        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4465    } else {
4466        let local_var_entity: Option<ListDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4467        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4468        Err(Error::ResponseError(local_var_error))
4469    }
4470}
4471
4472/// Returns admins and members of wm_deployers in the parent workspace of the fork at `{workspace}`.
4473pub async fn list_deployment_request_eligible_deployers(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DeploymentRequestEligibleDeployer>, Error<ListDeploymentRequestEligibleDeployersError>> {
4474    let local_var_configuration = configuration;
4475
4476    let local_var_client = &local_var_configuration.client;
4477
4478    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/eligible_deployers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4479    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4480
4481    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4482        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4483    }
4484    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4485        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4486    };
4487
4488    let local_var_req = local_var_req_builder.build()?;
4489    let local_var_resp = local_var_client.execute(local_var_req).await?;
4490
4491    let local_var_status = local_var_resp.status();
4492    let local_var_content = local_var_resp.text().await?;
4493
4494    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4495        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4496    } else {
4497        let local_var_entity: Option<ListDeploymentRequestEligibleDeployersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4498        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4499        Err(Error::ResponseError(local_var_error))
4500    }
4501}
4502
4503pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
4504    let local_var_configuration = configuration;
4505
4506    let local_var_client = &local_var_configuration.client;
4507
4508    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4509    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4510
4511    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4512        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4513    }
4514    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4515        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4516    };
4517
4518    let local_var_req = local_var_req_builder.build()?;
4519    let local_var_resp = local_var_client.execute(local_var_req).await?;
4520
4521    let local_var_status = local_var_resp.status();
4522    let local_var_content = local_var_resp.text().await?;
4523
4524    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4525        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4526    } else {
4527        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4528        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4529        Err(Error::ResponseError(local_var_error))
4530    }
4531}
4532
4533pub async fn list_password_login_members(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListPasswordLoginMembers200ResponseInner>, Error<ListPasswordLoginMembersError>> {
4534    let local_var_configuration = configuration;
4535
4536    let local_var_client = &local_var_configuration.client;
4537
4538    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/password_login_members", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4539    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4540
4541    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4542        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4543    }
4544    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4545        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4546    };
4547
4548    let local_var_req = local_var_req_builder.build()?;
4549    let local_var_resp = local_var_client.execute(local_var_req).await?;
4550
4551    let local_var_status = local_var_resp.status();
4552    let local_var_content = local_var_resp.text().await?;
4553
4554    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4555        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4556    } else {
4557        let local_var_entity: Option<ListPasswordLoginMembersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4558        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4559        Err(Error::ResponseError(local_var_error))
4560    }
4561}
4562
4563pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
4564    let local_var_configuration = configuration;
4565
4566    let local_var_client = &local_var_configuration.client;
4567
4568    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4569    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4570
4571    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4572        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4573    }
4574    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4575        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4576    };
4577
4578    let local_var_req = local_var_req_builder.build()?;
4579    let local_var_resp = local_var_client.execute(local_var_req).await?;
4580
4581    let local_var_status = local_var_resp.status();
4582    let local_var_content = local_var_resp.text().await?;
4583
4584    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4585        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4586    } else {
4587        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4588        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4589        Err(Error::ResponseError(local_var_error))
4590    }
4591}
4592
4593pub async fn list_protection_rules(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ProtectionRuleset>, Error<ListProtectionRulesError>> {
4594    let local_var_configuration = configuration;
4595
4596    let local_var_client = &local_var_configuration.client;
4597
4598    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4599    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4600
4601    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4602        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4603    }
4604    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4605        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4606    };
4607
4608    let local_var_req = local_var_req_builder.build()?;
4609    let local_var_resp = local_var_client.execute(local_var_req).await?;
4610
4611    let local_var_status = local_var_resp.status();
4612    let local_var_content = local_var_resp.text().await?;
4613
4614    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4615        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4616    } else {
4617        let local_var_entity: Option<ListProtectionRulesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4618        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4619        Err(Error::ResponseError(local_var_error))
4620    }
4621}
4622
4623pub async fn list_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::ListSharedUi200Response, Error<ListSharedUiError>> {
4624    let local_var_configuration = configuration;
4625
4626    let local_var_client = &local_var_configuration.client;
4627
4628    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4629    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4630
4631    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4632        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4633    }
4634    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4635        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4636    };
4637
4638    let local_var_req = local_var_req_builder.build()?;
4639    let local_var_resp = local_var_client.execute(local_var_req).await?;
4640
4641    let local_var_status = local_var_resp.status();
4642    let local_var_content = local_var_resp.text().await?;
4643
4644    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4645        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4646    } else {
4647        let local_var_entity: Option<ListSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4648        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4649        Err(Error::ResponseError(local_var_error))
4650    }
4651}
4652
4653pub async fn list_usable_datatable_roles(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::ListUsableDatatableRoles200Response, Error<ListUsableDatatableRolesError>> {
4654    let local_var_configuration = configuration;
4655
4656    let local_var_client = &local_var_configuration.client;
4657
4658    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));
4659    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4660
4661    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4662        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4663    }
4664    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4665        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4666    };
4667
4668    let local_var_req = local_var_req_builder.build()?;
4669    let local_var_resp = local_var_client.execute(local_var_req).await?;
4670
4671    let local_var_status = local_var_resp.status();
4672    let local_var_content = local_var_resp.text().await?;
4673
4674    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4675        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4676    } else {
4677        let local_var_entity: Option<ListUsableDatatableRolesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4678        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4679        Err(Error::ResponseError(local_var_error))
4680    }
4681}
4682
4683pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
4684    let local_var_configuration = configuration;
4685
4686    let local_var_client = &local_var_configuration.client;
4687
4688    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
4689    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4690
4691    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4692        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4693    }
4694    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4695        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4696    };
4697
4698    let local_var_req = local_var_req_builder.build()?;
4699    let local_var_resp = local_var_client.execute(local_var_req).await?;
4700
4701    let local_var_status = local_var_resp.status();
4702    let local_var_content = local_var_resp.text().await?;
4703
4704    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4705        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4706    } else {
4707        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4708        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4709        Err(Error::ResponseError(local_var_error))
4710    }
4711}
4712
4713/// 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.
4714pub async fn list_workspace_roles(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceRoles, Error<ListWorkspaceRolesError>> {
4715    let local_var_configuration = configuration;
4716
4717    let local_var_client = &local_var_configuration.client;
4718
4719    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/roles", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4720    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4721
4722    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4723        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4724    }
4725    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4726        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4727    };
4728
4729    let local_var_req = local_var_req_builder.build()?;
4730    let local_var_resp = local_var_client.execute(local_var_req).await?;
4731
4732    let local_var_status = local_var_resp.status();
4733    let local_var_content = local_var_resp.text().await?;
4734
4735    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4736        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4737    } else {
4738        let local_var_entity: Option<ListWorkspaceRolesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4739        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4740        Err(Error::ResponseError(local_var_error))
4741    }
4742}
4743
4744pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
4745    let local_var_configuration = configuration;
4746
4747    let local_var_client = &local_var_configuration.client;
4748
4749    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
4750    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4751
4752    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4753        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4754    }
4755    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4756        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4757    };
4758
4759    let local_var_req = local_var_req_builder.build()?;
4760    let local_var_resp = local_var_client.execute(local_var_req).await?;
4761
4762    let local_var_status = local_var_resp.status();
4763    let local_var_content = local_var_resp.text().await?;
4764
4765    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4766        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4767    } else {
4768        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4769        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4770        Err(Error::ResponseError(local_var_error))
4771    }
4772}
4773
4774pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
4775    let local_var_configuration = configuration;
4776
4777    let local_var_client = &local_var_configuration.client;
4778
4779    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
4780    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4781
4782    if let Some(ref local_var_str) = page {
4783        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
4784    }
4785    if let Some(ref local_var_str) = per_page {
4786        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
4787    }
4788    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4789        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4790    }
4791    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4792        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4793    };
4794
4795    let local_var_req = local_var_req_builder.build()?;
4796    let local_var_resp = local_var_client.execute(local_var_req).await?;
4797
4798    let local_var_status = local_var_resp.status();
4799    let local_var_content = local_var_resp.text().await?;
4800
4801    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4802        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4803    } else {
4804        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4805        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4806        Err(Error::ResponseError(local_var_error))
4807    }
4808}
4809
4810pub async fn list_ws_specific(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListWsSpecific200ResponseInner>, Error<ListWsSpecificError>> {
4811    let local_var_configuration = configuration;
4812
4813    let local_var_client = &local_var_configuration.client;
4814
4815    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4816    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4817
4818    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4819        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4820    }
4821    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4822        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4823    };
4824
4825    let local_var_req = local_var_req_builder.build()?;
4826    let local_var_resp = local_var_client.execute(local_var_req).await?;
4827
4828    let local_var_status = local_var_resp.status();
4829    let local_var_content = local_var_resp.text().await?;
4830
4831    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4832        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4833    } else {
4834        let local_var_entity: Option<ListWsSpecificError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4835        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4836        Err(Error::ResponseError(local_var_error))
4837    }
4838}
4839
4840pub async fn list_ws_specific_versions(configuration: &configuration::Configuration, workspace: &str, kind: &str, path: &str) -> Result<Vec<String>, Error<ListWsSpecificVersionsError>> {
4841    let local_var_configuration = configuration;
4842
4843    let local_var_client = &local_var_configuration.client;
4844
4845    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4846    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4847
4848    local_var_req_builder = local_var_req_builder.query(&[("kind", &kind.to_string())]);
4849    local_var_req_builder = local_var_req_builder.query(&[("path", &path.to_string())]);
4850    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4851        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4852    }
4853    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4854        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4855    };
4856
4857    let local_var_req = local_var_req_builder.build()?;
4858    let local_var_resp = local_var_client.execute(local_var_req).await?;
4859
4860    let local_var_status = local_var_resp.status();
4861    let local_var_content = local_var_resp.text().await?;
4862
4863    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4864        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4865    } else {
4866        let local_var_entity: Option<ListWsSpecificVersionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4867        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4868        Err(Error::ResponseError(local_var_error))
4869    }
4870}
4871
4872pub async fn log_feature_usage(configuration: &configuration::Configuration, workspace: &str, log_feature_usage_request: models::LogFeatureUsageRequest) -> Result<(), Error<LogFeatureUsageError>> {
4873    let local_var_configuration = configuration;
4874
4875    let local_var_client = &local_var_configuration.client;
4876
4877    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/log_feature_usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4878    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4879
4880    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4881        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4882    }
4883    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4884        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4885    };
4886    local_var_req_builder = local_var_req_builder.json(&log_feature_usage_request);
4887
4888    let local_var_req = local_var_req_builder.build()?;
4889    let local_var_resp = local_var_client.execute(local_var_req).await?;
4890
4891    let local_var_status = local_var_resp.status();
4892    let local_var_content = local_var_resp.text().await?;
4893
4894    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4895        Ok(())
4896    } else {
4897        let local_var_entity: Option<LogFeatureUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4898        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4899        Err(Error::ResponseError(local_var_error))
4900    }
4901}
4902
4903pub async fn plan_datatable_acl(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, acl_change_request: models::AclChangeRequest) -> Result<models::AclPlan, Error<PlanDatatableAclError>> {
4904    let local_var_configuration = configuration;
4905
4906    let local_var_client = &local_var_configuration.client;
4907
4908    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));
4909    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4910
4911    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4912        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4913    }
4914    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4915        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4916    };
4917    local_var_req_builder = local_var_req_builder.json(&acl_change_request);
4918
4919    let local_var_req = local_var_req_builder.build()?;
4920    let local_var_resp = local_var_client.execute(local_var_req).await?;
4921
4922    let local_var_status = local_var_resp.status();
4923    let local_var_content = local_var_resp.text().await?;
4924
4925    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4926        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4927    } else {
4928        let local_var_entity: Option<PlanDatatableAclError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4929        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4930        Err(Error::ResponseError(local_var_error))
4931    }
4932}
4933
4934pub async fn prune_versions(configuration: &configuration::Configuration, workspace: &str, prune_versions_request: models::PruneVersionsRequest) -> Result<models::PruneVersions200Response, Error<PruneVersionsError>> {
4935    let local_var_configuration = configuration;
4936
4937    let local_var_client = &local_var_configuration.client;
4938
4939    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/prune_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4940    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4941
4942    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4943        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4944    }
4945    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4946        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4947    };
4948    local_var_req_builder = local_var_req_builder.json(&prune_versions_request);
4949
4950    let local_var_req = local_var_req_builder.build()?;
4951    let local_var_resp = local_var_client.execute(local_var_req).await?;
4952
4953    let local_var_status = local_var_resp.status();
4954    let local_var_content = local_var_resp.text().await?;
4955
4956    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4957        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4958    } else {
4959        let local_var_entity: Option<PruneVersionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4960        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4961        Err(Error::ResponseError(local_var_error))
4962    }
4963}
4964
4965pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
4966    let local_var_configuration = configuration;
4967
4968    let local_var_client = &local_var_configuration.client;
4969
4970    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4971    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4972
4973    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4974        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4975    }
4976    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4977        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4978    };
4979
4980    let local_var_req = local_var_req_builder.build()?;
4981    let local_var_resp = local_var_client.execute(local_var_req).await?;
4982
4983    let local_var_status = local_var_resp.status();
4984    let local_var_content = local_var_resp.text().await?;
4985
4986    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4987        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4988    } else {
4989        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4990        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4991        Err(Error::ResponseError(local_var_error))
4992    }
4993}
4994
4995/// This endpoint should be called after a fork deployement
4996pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
4997    let local_var_configuration = configuration;
4998
4999    let local_var_client = &local_var_configuration.client;
5000
5001    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));
5002    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5003
5004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5006    }
5007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5009    };
5010
5011    let local_var_req = local_var_req_builder.build()?;
5012    let local_var_resp = local_var_client.execute(local_var_req).await?;
5013
5014    let local_var_status = local_var_resp.status();
5015    let local_var_content = local_var_resp.text().await?;
5016
5017    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5018        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5019    } else {
5020        let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5021        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5022        Err(Error::ResponseError(local_var_error))
5023    }
5024}
5025
5026pub async fn rollback_datatable_migrations(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, only: Option<i64>) -> Result<models::RollbackDatatableMigrations200Response, Error<RollbackDatatableMigrationsError>> {
5027    let local_var_configuration = configuration;
5028
5029    let local_var_client = &local_var_configuration.client;
5030
5031    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));
5032    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5033
5034    if let Some(ref local_var_str) = only {
5035        local_var_req_builder = local_var_req_builder.query(&[("only", &local_var_str.to_string())]);
5036    }
5037    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5038        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5039    }
5040    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5041        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5042    };
5043
5044    let local_var_req = local_var_req_builder.build()?;
5045    let local_var_resp = local_var_client.execute(local_var_req).await?;
5046
5047    let local_var_status = local_var_resp.status();
5048    let local_var_content = local_var_resp.text().await?;
5049
5050    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5051        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5052    } else {
5053        let local_var_entity: Option<RollbackDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5054        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5055        Err(Error::ResponseError(local_var_error))
5056    }
5057}
5058
5059pub 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>> {
5060    let local_var_configuration = configuration;
5061
5062    let local_var_client = &local_var_configuration.client;
5063
5064    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));
5065    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5066
5067    if let Some(ref local_var_str) = up_to {
5068        local_var_req_builder = local_var_req_builder.query(&[("up_to", &local_var_str.to_string())]);
5069    }
5070    if let Some(ref local_var_str) = only {
5071        local_var_req_builder = local_var_req_builder.query(&[("only", &local_var_str.to_string())]);
5072    }
5073    if let Some(ref local_var_str) = schema {
5074        local_var_req_builder = local_var_req_builder.query(&[("schema", &local_var_str.to_string())]);
5075    }
5076    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5077        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5078    }
5079    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5080        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5081    };
5082
5083    let local_var_req = local_var_req_builder.build()?;
5084    let local_var_resp = local_var_client.execute(local_var_req).await?;
5085
5086    let local_var_status = local_var_resp.status();
5087    let local_var_content = local_var_resp.text().await?;
5088
5089    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5090        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5091    } else {
5092        let local_var_entity: Option<RunDatatableMigrationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5093        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5094        Err(Error::ResponseError(local_var_error))
5095    }
5096}
5097
5098pub 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>> {
5099    let local_var_configuration = configuration;
5100
5101    let local_var_client = &local_var_configuration.client;
5102
5103    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5104    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5105
5106    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5107        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5108    }
5109    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5110        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5111    };
5112    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
5113
5114    let local_var_req = local_var_req_builder.build()?;
5115    let local_var_resp = local_var_client.execute(local_var_req).await?;
5116
5117    let local_var_status = local_var_resp.status();
5118    let local_var_content = local_var_resp.text().await?;
5119
5120    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5121        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5122    } else {
5123        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5124        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5125        Err(Error::ResponseError(local_var_error))
5126    }
5127}
5128
5129pub 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>> {
5130    let local_var_configuration = configuration;
5131
5132    let local_var_client = &local_var_configuration.client;
5133
5134    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5135    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5136
5137    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5138        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5139    }
5140    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5141        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5142    };
5143    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
5144
5145    let local_var_req = local_var_req_builder.build()?;
5146    let local_var_resp = local_var_client.execute(local_var_req).await?;
5147
5148    let local_var_status = local_var_resp.status();
5149    let local_var_content = local_var_resp.text().await?;
5150
5151    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5152        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5153    } else {
5154        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5155        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5156        Err(Error::ResponseError(local_var_error))
5157    }
5158}
5159
5160/// 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.
5161pub async fn seed_full_diff_scan(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::SeedFullDiffScan200Response, Error<SeedFullDiffScanError>> {
5162    let local_var_configuration = configuration;
5163
5164    let local_var_client = &local_var_configuration.client;
5165
5166    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));
5167    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5168
5169    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5170        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5171    }
5172    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5173        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5174    };
5175
5176    let local_var_req = local_var_req_builder.build()?;
5177    let local_var_resp = local_var_client.execute(local_var_req).await?;
5178
5179    let local_var_status = local_var_resp.status();
5180    let local_var_content = local_var_resp.text().await?;
5181
5182    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5183        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5184    } else {
5185        let local_var_entity: Option<SeedFullDiffScanError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5186        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5187        Err(Error::ResponseError(local_var_error))
5188    }
5189}
5190
5191pub async fn set_datatable_permissions(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, set_datatable_permissions_request: models::SetDatatablePermissionsRequest) -> Result<String, Error<SetDatatablePermissionsError>> {
5192    let local_var_configuration = configuration;
5193
5194    let local_var_client = &local_var_configuration.client;
5195
5196    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));
5197    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5198
5199    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5200        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5201    }
5202    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5203        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5204    };
5205    local_var_req_builder = local_var_req_builder.json(&set_datatable_permissions_request);
5206
5207    let local_var_req = local_var_req_builder.build()?;
5208    let local_var_resp = local_var_client.execute(local_var_req).await?;
5209
5210    let local_var_status = local_var_resp.status();
5211    let local_var_content = local_var_resp.text().await?;
5212
5213    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5214        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5215    } else {
5216        let local_var_entity: Option<SetDatatablePermissionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5217        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5218        Err(Error::ResponseError(local_var_error))
5219    }
5220}
5221
5222pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
5223    let local_var_configuration = configuration;
5224
5225    let local_var_client = &local_var_configuration.client;
5226
5227    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5228    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5229
5230    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5231        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5232    }
5233    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5234        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5235    };
5236    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
5237
5238    let local_var_req = local_var_req_builder.build()?;
5239    let local_var_resp = local_var_client.execute(local_var_req).await?;
5240
5241    let local_var_status = local_var_resp.status();
5242    let local_var_content = local_var_resp.text().await?;
5243
5244    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5245        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5246    } else {
5247        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5248        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5249        Err(Error::ResponseError(local_var_error))
5250    }
5251}
5252
5253/// Changing the target drops every token stored for the previous one.
5254pub async fn set_remote_deploy_target(configuration: &configuration::Configuration, workspace: &str, set_remote_deploy_target_request: models::SetRemoteDeployTargetRequest) -> Result<String, Error<SetRemoteDeployTargetError>> {
5255    let local_var_configuration = configuration;
5256
5257    let local_var_client = &local_var_configuration.client;
5258
5259    let local_var_uri_str = format!("{}/w/{workspace}/remote_deploy/target", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5260    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5261
5262    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5263        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5264    }
5265    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5266        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5267    };
5268    local_var_req_builder = local_var_req_builder.json(&set_remote_deploy_target_request);
5269
5270    let local_var_req = local_var_req_builder.build()?;
5271    let local_var_resp = local_var_client.execute(local_var_req).await?;
5272
5273    let local_var_status = local_var_resp.status();
5274    let local_var_content = local_var_resp.text().await?;
5275
5276    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5277        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5278    } else {
5279        let local_var_entity: Option<SetRemoteDeployTargetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5280        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5281        Err(Error::ResponseError(local_var_error))
5282    }
5283}
5284
5285pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
5286    let local_var_configuration = configuration;
5287
5288    let local_var_client = &local_var_configuration.client;
5289
5290    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5291    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5292
5293    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5294        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5295    }
5296    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5297        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5298    };
5299    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
5300
5301    let local_var_req = local_var_req_builder.build()?;
5302    let local_var_resp = local_var_client.execute(local_var_req).await?;
5303
5304    let local_var_status = local_var_resp.status();
5305    let local_var_content = local_var_resp.text().await?;
5306
5307    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5308        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5309    } else {
5310        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5311        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5312        Err(Error::ResponseError(local_var_error))
5313    }
5314}
5315
5316pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
5317    let local_var_configuration = configuration;
5318
5319    let local_var_client = &local_var_configuration.client;
5320
5321    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5322    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5323
5324    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5325        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5326    }
5327    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5328        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5329    };
5330    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
5331
5332    let local_var_req = local_var_req_builder.build()?;
5333    let local_var_resp = local_var_client.execute(local_var_req).await?;
5334
5335    let local_var_status = local_var_resp.status();
5336    let local_var_content = local_var_resp.text().await?;
5337
5338    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5339        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5340    } else {
5341        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5342        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5343        Err(Error::ResponseError(local_var_error))
5344    }
5345}
5346
5347pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
5348    let local_var_configuration = configuration;
5349
5350    let local_var_client = &local_var_configuration.client;
5351
5352    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5353    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5354
5355    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5356        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5357    }
5358    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5359        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5360    };
5361    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
5362
5363    let local_var_req = local_var_req_builder.build()?;
5364    let local_var_resp = local_var_client.execute(local_var_req).await?;
5365
5366    let local_var_status = local_var_resp.status();
5367    let local_var_content = local_var_resp.text().await?;
5368
5369    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5370        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5371    } else {
5372        let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5373        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5374        Err(Error::ResponseError(local_var_error))
5375    }
5376}
5377
5378pub async fn set_workspace_slack_signing_secret(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_signing_secret_request: models::SetWorkspaceSlackSigningSecretRequest) -> Result<String, Error<SetWorkspaceSlackSigningSecretError>> {
5379    let local_var_configuration = configuration;
5380
5381    let local_var_client = &local_var_configuration.client;
5382
5383    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_signing_secret", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5384    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5385
5386    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5387        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5388    }
5389    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5390        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5391    };
5392    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_signing_secret_request);
5393
5394    let local_var_req = local_var_req_builder.build()?;
5395    let local_var_resp = local_var_client.execute(local_var_req).await?;
5396
5397    let local_var_status = local_var_resp.status();
5398    let local_var_content = local_var_resp.text().await?;
5399
5400    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5401        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5402    } else {
5403        let local_var_entity: Option<SetWorkspaceSlackSigningSecretError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5404        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5405        Err(Error::ResponseError(local_var_error))
5406    }
5407}
5408
5409pub async fn set_ws_specific(configuration: &configuration::Configuration, workspace: &str, set_ws_specific_request: models::SetWsSpecificRequest) -> Result<String, Error<SetWsSpecificError>> {
5410    let local_var_configuration = configuration;
5411
5412    let local_var_client = &local_var_configuration.client;
5413
5414    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_ws_specific", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5415    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5416
5417    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5418        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5419    }
5420    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5421        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5422    };
5423    local_var_req_builder = local_var_req_builder.json(&set_ws_specific_request);
5424
5425    let local_var_req = local_var_req_builder.build()?;
5426    let local_var_resp = local_var_client.execute(local_var_req).await?;
5427
5428    let local_var_status = local_var_resp.status();
5429    let local_var_content = local_var_resp.text().await?;
5430
5431    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5432        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5433    } else {
5434        let local_var_entity: Option<SetWsSpecificError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5435        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5436        Err(Error::ResponseError(local_var_error))
5437    }
5438}
5439
5440pub async fn test_data_table_connection(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str) -> Result<models::TestDataTableConnection200Response, Error<TestDataTableConnectionError>> {
5441    let local_var_configuration = configuration;
5442
5443    let local_var_client = &local_var_configuration.client;
5444
5445    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));
5446    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
5447
5448    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5449        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5450    }
5451    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5452        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5453    };
5454
5455    let local_var_req = local_var_req_builder.build()?;
5456    let local_var_resp = local_var_client.execute(local_var_req).await?;
5457
5458    let local_var_status = local_var_resp.status();
5459    let local_var_content = local_var_resp.text().await?;
5460
5461    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5462        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5463    } else {
5464        let local_var_entity: Option<TestDataTableConnectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5465        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5466        Err(Error::ResponseError(local_var_error))
5467    }
5468}
5469
5470pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
5471    let local_var_configuration = configuration;
5472
5473    let local_var_client = &local_var_configuration.client;
5474
5475    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5476    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5477
5478    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5479        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5480    }
5481    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5482        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5483    };
5484
5485    let local_var_req = local_var_req_builder.build()?;
5486    let local_var_resp = local_var_client.execute(local_var_req).await?;
5487
5488    let local_var_status = local_var_resp.status();
5489    let local_var_content = local_var_resp.text().await?;
5490
5491    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5492        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5493    } else {
5494        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5495        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5496        Err(Error::ResponseError(local_var_error))
5497    }
5498}
5499
5500/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
5501pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
5502    let local_var_configuration = configuration;
5503
5504    let local_var_client = &local_var_configuration.client;
5505
5506    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5507    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5508
5509    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5510        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5511    }
5512    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5513        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5514    };
5515    local_var_req_builder = local_var_req_builder.json(&operator_settings);
5516
5517    let local_var_req = local_var_req_builder.build()?;
5518    let local_var_resp = local_var_client.execute(local_var_req).await?;
5519
5520    let local_var_status = local_var_resp.status();
5521    let local_var_content = local_var_resp.text().await?;
5522
5523    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5524        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5525    } else {
5526        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5527        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5528        Err(Error::ResponseError(local_var_error))
5529    }
5530}
5531
5532pub async fn update_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str, update_protection_rule_request: models::UpdateProtectionRuleRequest) -> Result<String, Error<UpdateProtectionRuleError>> {
5533    let local_var_configuration = configuration;
5534
5535    let local_var_client = &local_var_configuration.client;
5536
5537    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));
5538    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5539
5540    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5541        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5542    }
5543    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5544        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5545    };
5546    local_var_req_builder = local_var_req_builder.json(&update_protection_rule_request);
5547
5548    let local_var_req = local_var_req_builder.build()?;
5549    let local_var_resp = local_var_client.execute(local_var_req).await?;
5550
5551    let local_var_status = local_var_resp.status();
5552    let local_var_content = local_var_resp.text().await?;
5553
5554    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5555        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5556    } else {
5557        let local_var_entity: Option<UpdateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5558        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5559        Err(Error::ResponseError(local_var_error))
5560    }
5561}
5562
5563pub async fn update_shared_ui(configuration: &configuration::Configuration, workspace: &str, update_shared_ui_request: models::UpdateSharedUiRequest) -> Result<String, Error<UpdateSharedUiError>> {
5564    let local_var_configuration = configuration;
5565
5566    let local_var_client = &local_var_configuration.client;
5567
5568    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5569    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
5570
5571    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5572        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5573    }
5574    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5575        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5576    };
5577    local_var_req_builder = local_var_req_builder.json(&update_shared_ui_request);
5578
5579    let local_var_req = local_var_req_builder.build()?;
5580    let local_var_resp = local_var_client.execute(local_var_req).await?;
5581
5582    let local_var_status = local_var_resp.status();
5583    let local_var_content = local_var_resp.text().await?;
5584
5585    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5586        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5587    } else {
5588        let local_var_entity: Option<UpdateSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5589        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5590        Err(Error::ResponseError(local_var_error))
5591    }
5592}
5593
5594/// 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.
5595pub async fn update_workspace_role_overrides(configuration: &configuration::Configuration, workspace: &str, request_body: std::collections::HashMap<String, models::RoleOverride>) -> Result<String, Error<UpdateWorkspaceRoleOverridesError>> {
5596    let local_var_configuration = configuration;
5597
5598    let local_var_client = &local_var_configuration.client;
5599
5600    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/role_overrides", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5601    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5602
5603    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5604        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5605    }
5606    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5607        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5608    };
5609    local_var_req_builder = local_var_req_builder.json(&request_body);
5610
5611    let local_var_req = local_var_req_builder.build()?;
5612    let local_var_resp = local_var_client.execute(local_var_req).await?;
5613
5614    let local_var_status = local_var_resp.status();
5615    let local_var_content = local_var_resp.text().await?;
5616
5617    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5618        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5619    } else {
5620        let local_var_entity: Option<UpdateWorkspaceRoleOverridesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5621        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5622        Err(Error::ResponseError(local_var_error))
5623    }
5624}
5625
5626pub async fn upsert_datatable_migration(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, upsert_datatable_migration_request: models::UpsertDatatableMigrationRequest) -> Result<String, Error<UpsertDatatableMigrationError>> {
5627    let local_var_configuration = configuration;
5628
5629    let local_var_client = &local_var_configuration.client;
5630
5631    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));
5632    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5633
5634    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5635        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5636    }
5637    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5638        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5639    };
5640    local_var_req_builder = local_var_req_builder.json(&upsert_datatable_migration_request);
5641
5642    let local_var_req = local_var_req_builder.build()?;
5643    let local_var_resp = local_var_client.execute(local_var_req).await?;
5644
5645    let local_var_status = local_var_resp.status();
5646    let local_var_content = local_var_resp.text().await?;
5647
5648    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5649        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5650    } else {
5651        let local_var_entity: Option<UpsertDatatableMigrationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5652        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5653        Err(Error::ResponseError(local_var_error))
5654    }
5655}
5656