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