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