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