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