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.693.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 [`archive_workspace`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ArchiveWorkspaceError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`cancel_deployment_request`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CancelDeploymentRequestError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`change_workspace_color`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum ChangeWorkspaceColorError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`change_workspace_id`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ChangeWorkspaceIdError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`change_workspace_name`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ChangeWorkspaceNameError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`close_deployment_request_merged`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CloseDeploymentRequestMergedError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`compare_workspaces`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CompareWorkspacesError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`connect_slack`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum ConnectSlackError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`connect_teams`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum ConnectTeamsError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`create_deployment_request`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum CreateDeploymentRequestError {
92    Status400(),
93    Status409(),
94    UnknownValue(serde_json::Value),
95}
96
97/// struct for typed errors of method [`create_deployment_request_comment`]
98#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum CreateDeploymentRequestCommentError {
101    Status400(),
102    UnknownValue(serde_json::Value),
103}
104
105/// struct for typed errors of method [`create_pg_database`]
106#[derive(Debug, Clone, Serialize, Deserialize)]
107#[serde(untagged)]
108pub enum CreatePgDatabaseError {
109    UnknownValue(serde_json::Value),
110}
111
112/// struct for typed errors of method [`create_protection_rule`]
113#[derive(Debug, Clone, Serialize, Deserialize)]
114#[serde(untagged)]
115pub enum CreateProtectionRuleError {
116    Status400(),
117    UnknownValue(serde_json::Value),
118}
119
120/// struct for typed errors of method [`create_service_account`]
121#[derive(Debug, Clone, Serialize, Deserialize)]
122#[serde(untagged)]
123pub enum CreateServiceAccountError {
124    UnknownValue(serde_json::Value),
125}
126
127/// struct for typed errors of method [`create_workspace`]
128#[derive(Debug, Clone, Serialize, Deserialize)]
129#[serde(untagged)]
130pub enum CreateWorkspaceError {
131    UnknownValue(serde_json::Value),
132}
133
134/// struct for typed errors of method [`create_workspace_fork`]
135#[derive(Debug, Clone, Serialize, Deserialize)]
136#[serde(untagged)]
137pub enum CreateWorkspaceForkError {
138    UnknownValue(serde_json::Value),
139}
140
141/// struct for typed errors of method [`create_workspace_fork_git_branch`]
142#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(untagged)]
144pub enum CreateWorkspaceForkGitBranchError {
145    UnknownValue(serde_json::Value),
146}
147
148/// struct for typed errors of method [`delete_git_sync_repository`]
149#[derive(Debug, Clone, Serialize, Deserialize)]
150#[serde(untagged)]
151pub enum DeleteGitSyncRepositoryError {
152    UnknownValue(serde_json::Value),
153}
154
155/// struct for typed errors of method [`delete_invite`]
156#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(untagged)]
158pub enum DeleteInviteError {
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`delete_protection_rule`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum DeleteProtectionRuleError {
166    Status404(),
167    UnknownValue(serde_json::Value),
168}
169
170/// struct for typed errors of method [`delete_workspace`]
171#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum DeleteWorkspaceError {
174    UnknownValue(serde_json::Value),
175}
176
177/// struct for typed errors of method [`delete_workspace_slack_oauth_config`]
178#[derive(Debug, Clone, Serialize, Deserialize)]
179#[serde(untagged)]
180pub enum DeleteWorkspaceSlackOauthConfigError {
181    UnknownValue(serde_json::Value),
182}
183
184/// struct for typed errors of method [`drop_forked_datatable_databases`]
185#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(untagged)]
187pub enum DropForkedDatatableDatabasesError {
188    UnknownValue(serde_json::Value),
189}
190
191/// struct for typed errors of method [`edit_auto_invite`]
192#[derive(Debug, Clone, Serialize, Deserialize)]
193#[serde(untagged)]
194pub enum EditAutoInviteError {
195    UnknownValue(serde_json::Value),
196}
197
198/// struct for typed errors of method [`edit_copilot_config`]
199#[derive(Debug, Clone, Serialize, Deserialize)]
200#[serde(untagged)]
201pub enum EditCopilotConfigError {
202    UnknownValue(serde_json::Value),
203}
204
205/// struct for typed errors of method [`edit_data_table_config`]
206#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum EditDataTableConfigError {
209    UnknownValue(serde_json::Value),
210}
211
212/// struct for typed errors of method [`edit_default_scripts`]
213#[derive(Debug, Clone, Serialize, Deserialize)]
214#[serde(untagged)]
215pub enum EditDefaultScriptsError {
216    UnknownValue(serde_json::Value),
217}
218
219/// struct for typed errors of method [`edit_deploy_to`]
220#[derive(Debug, Clone, Serialize, Deserialize)]
221#[serde(untagged)]
222pub enum EditDeployToError {
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method [`edit_ducklake_config`]
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum EditDucklakeConfigError {
230    UnknownValue(serde_json::Value),
231}
232
233/// struct for typed errors of method [`edit_error_handler`]
234#[derive(Debug, Clone, Serialize, Deserialize)]
235#[serde(untagged)]
236pub enum EditErrorHandlerError {
237    UnknownValue(serde_json::Value),
238}
239
240/// struct for typed errors of method [`edit_git_sync_repository`]
241#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum EditGitSyncRepositoryError {
244    UnknownValue(serde_json::Value),
245}
246
247/// struct for typed errors of method [`edit_instance_groups`]
248#[derive(Debug, Clone, Serialize, Deserialize)]
249#[serde(untagged)]
250pub enum EditInstanceGroupsError {
251    UnknownValue(serde_json::Value),
252}
253
254/// struct for typed errors of method [`edit_large_file_storage_config`]
255#[derive(Debug, Clone, Serialize, Deserialize)]
256#[serde(untagged)]
257pub enum EditLargeFileStorageConfigError {
258    UnknownValue(serde_json::Value),
259}
260
261/// struct for typed errors of method [`edit_slack_command`]
262#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum EditSlackCommandError {
265    UnknownValue(serde_json::Value),
266}
267
268/// struct for typed errors of method [`edit_success_handler`]
269#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum EditSuccessHandlerError {
272    UnknownValue(serde_json::Value),
273}
274
275/// struct for typed errors of method [`edit_teams_command`]
276#[derive(Debug, Clone, Serialize, Deserialize)]
277#[serde(untagged)]
278pub enum EditTeamsCommandError {
279    UnknownValue(serde_json::Value),
280}
281
282/// struct for typed errors of method [`edit_webhook`]
283#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum EditWebhookError {
286    UnknownValue(serde_json::Value),
287}
288
289/// struct for typed errors of method [`edit_workspace_default_app`]
290#[derive(Debug, Clone, Serialize, Deserialize)]
291#[serde(untagged)]
292pub enum EditWorkspaceDefaultAppError {
293    UnknownValue(serde_json::Value),
294}
295
296/// struct for typed errors of method [`edit_workspace_deploy_ui_settings`]
297#[derive(Debug, Clone, Serialize, Deserialize)]
298#[serde(untagged)]
299pub enum EditWorkspaceDeployUiSettingsError {
300    UnknownValue(serde_json::Value),
301}
302
303/// struct for typed errors of method [`edit_workspace_git_sync_config`]
304#[derive(Debug, Clone, Serialize, Deserialize)]
305#[serde(untagged)]
306pub enum EditWorkspaceGitSyncConfigError {
307    UnknownValue(serde_json::Value),
308}
309
310/// struct for typed errors of method [`exists_username`]
311#[derive(Debug, Clone, Serialize, Deserialize)]
312#[serde(untagged)]
313pub enum ExistsUsernameError {
314    UnknownValue(serde_json::Value),
315}
316
317/// struct for typed errors of method [`exists_workspace`]
318#[derive(Debug, Clone, Serialize, Deserialize)]
319#[serde(untagged)]
320pub enum ExistsWorkspaceError {
321    UnknownValue(serde_json::Value),
322}
323
324/// struct for typed errors of method [`export_pg_schema`]
325#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum ExportPgSchemaError {
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`get_cloud_quotas`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum GetCloudQuotasError {
335    UnknownValue(serde_json::Value),
336}
337
338/// struct for typed errors of method [`get_copilot_info`]
339#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum GetCopilotInfoError {
342    UnknownValue(serde_json::Value),
343}
344
345/// struct for typed errors of method [`get_copilot_settings_state`]
346#[derive(Debug, Clone, Serialize, Deserialize)]
347#[serde(untagged)]
348pub enum GetCopilotSettingsStateError {
349    UnknownValue(serde_json::Value),
350}
351
352/// struct for typed errors of method [`get_data_table_table_schema`]
353#[derive(Debug, Clone, Serialize, Deserialize)]
354#[serde(untagged)]
355pub enum GetDataTableTableSchemaError {
356    UnknownValue(serde_json::Value),
357}
358
359/// struct for typed errors of method [`get_datatable_full_schema`]
360#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum GetDatatableFullSchemaError {
363    UnknownValue(serde_json::Value),
364}
365
366/// struct for typed errors of method [`get_default_scripts`]
367#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum GetDefaultScriptsError {
370    UnknownValue(serde_json::Value),
371}
372
373/// struct for typed errors of method [`get_dependency_map`]
374#[derive(Debug, Clone, Serialize, Deserialize)]
375#[serde(untagged)]
376pub enum GetDependencyMapError {
377    UnknownValue(serde_json::Value),
378}
379
380/// struct for typed errors of method [`get_dependents`]
381#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(untagged)]
383pub enum GetDependentsError {
384    UnknownValue(serde_json::Value),
385}
386
387/// struct for typed errors of method [`get_dependents_amounts`]
388#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum GetDependentsAmountsError {
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`get_deploy_to`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum GetDeployToError {
398    UnknownValue(serde_json::Value),
399}
400
401/// struct for typed errors of method [`get_git_sync_enabled`]
402#[derive(Debug, Clone, Serialize, Deserialize)]
403#[serde(untagged)]
404pub enum GetGitSyncEnabledError {
405    UnknownValue(serde_json::Value),
406}
407
408/// struct for typed errors of method [`get_github_app_token`]
409#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum GetGithubAppTokenError {
412    UnknownValue(serde_json::Value),
413}
414
415/// struct for typed errors of method [`get_imports`]
416#[derive(Debug, Clone, Serialize, Deserialize)]
417#[serde(untagged)]
418pub enum GetImportsError {
419    UnknownValue(serde_json::Value),
420}
421
422/// struct for typed errors of method [`get_is_premium`]
423#[derive(Debug, Clone, Serialize, Deserialize)]
424#[serde(untagged)]
425pub enum GetIsPremiumError {
426    UnknownValue(serde_json::Value),
427}
428
429/// struct for typed errors of method [`get_open_deployment_request`]
430#[derive(Debug, Clone, Serialize, Deserialize)]
431#[serde(untagged)]
432pub enum GetOpenDeploymentRequestError {
433    UnknownValue(serde_json::Value),
434}
435
436/// struct for typed errors of method [`get_premium_info`]
437#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(untagged)]
439pub enum GetPremiumInfoError {
440    UnknownValue(serde_json::Value),
441}
442
443/// struct for typed errors of method [`get_settings`]
444#[derive(Debug, Clone, Serialize, Deserialize)]
445#[serde(untagged)]
446pub enum GetSettingsError {
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`get_shared_ui`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetSharedUiError {
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`get_shared_ui_version`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum GetSharedUiVersionError {
461    UnknownValue(serde_json::Value),
462}
463
464/// struct for typed errors of method [`get_threshold_alert`]
465#[derive(Debug, Clone, Serialize, Deserialize)]
466#[serde(untagged)]
467pub enum GetThresholdAlertError {
468    UnknownValue(serde_json::Value),
469}
470
471/// struct for typed errors of method [`get_used_triggers`]
472#[derive(Debug, Clone, Serialize, Deserialize)]
473#[serde(untagged)]
474pub enum GetUsedTriggersError {
475    UnknownValue(serde_json::Value),
476}
477
478/// struct for typed errors of method [`get_workspace_as_super_admin`]
479#[derive(Debug, Clone, Serialize, Deserialize)]
480#[serde(untagged)]
481pub enum GetWorkspaceAsSuperAdminError {
482    UnknownValue(serde_json::Value),
483}
484
485/// struct for typed errors of method [`get_workspace_default_app`]
486#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(untagged)]
488pub enum GetWorkspaceDefaultAppError {
489    UnknownValue(serde_json::Value),
490}
491
492/// struct for typed errors of method [`get_workspace_encryption_key`]
493#[derive(Debug, Clone, Serialize, Deserialize)]
494#[serde(untagged)]
495pub enum GetWorkspaceEncryptionKeyError {
496    UnknownValue(serde_json::Value),
497}
498
499/// struct for typed errors of method [`get_workspace_name`]
500#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum GetWorkspaceNameError {
503    UnknownValue(serde_json::Value),
504}
505
506/// struct for typed errors of method [`get_workspace_slack_oauth_config`]
507#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum GetWorkspaceSlackOauthConfigError {
510    UnknownValue(serde_json::Value),
511}
512
513/// struct for typed errors of method [`get_workspace_usage`]
514#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(untagged)]
516pub enum GetWorkspaceUsageError {
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`import_pg_database`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum ImportPgDatabaseError {
524    UnknownValue(serde_json::Value),
525}
526
527/// struct for typed errors of method [`invite_user`]
528#[derive(Debug, Clone, Serialize, Deserialize)]
529#[serde(untagged)]
530pub enum InviteUserError {
531    UnknownValue(serde_json::Value),
532}
533
534/// struct for typed errors of method [`is_domain_allowed`]
535#[derive(Debug, Clone, Serialize, Deserialize)]
536#[serde(untagged)]
537pub enum IsDomainAllowedError {
538    UnknownValue(serde_json::Value),
539}
540
541/// struct for typed errors of method [`leave_workspace`]
542#[derive(Debug, Clone, Serialize, Deserialize)]
543#[serde(untagged)]
544pub enum LeaveWorkspaceError {
545    UnknownValue(serde_json::Value),
546}
547
548/// struct for typed errors of method [`list_available_teams_channels`]
549#[derive(Debug, Clone, Serialize, Deserialize)]
550#[serde(untagged)]
551pub enum ListAvailableTeamsChannelsError {
552    UnknownValue(serde_json::Value),
553}
554
555/// struct for typed errors of method [`list_available_teams_ids`]
556#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(untagged)]
558pub enum ListAvailableTeamsIdsError {
559    UnknownValue(serde_json::Value),
560}
561
562/// struct for typed errors of method [`list_data_table_schemas`]
563#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum ListDataTableSchemasError {
566    UnknownValue(serde_json::Value),
567}
568
569/// struct for typed errors of method [`list_data_table_tables`]
570#[derive(Debug, Clone, Serialize, Deserialize)]
571#[serde(untagged)]
572pub enum ListDataTableTablesError {
573    UnknownValue(serde_json::Value),
574}
575
576/// struct for typed errors of method [`list_data_tables`]
577#[derive(Debug, Clone, Serialize, Deserialize)]
578#[serde(untagged)]
579pub enum ListDataTablesError {
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`list_deployment_request_eligible_deployers`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum ListDeploymentRequestEligibleDeployersError {
587    UnknownValue(serde_json::Value),
588}
589
590/// struct for typed errors of method [`list_ducklakes`]
591#[derive(Debug, Clone, Serialize, Deserialize)]
592#[serde(untagged)]
593pub enum ListDucklakesError {
594    UnknownValue(serde_json::Value),
595}
596
597/// struct for typed errors of method [`list_pending_invites`]
598#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum ListPendingInvitesError {
601    UnknownValue(serde_json::Value),
602}
603
604/// struct for typed errors of method [`list_protection_rules`]
605#[derive(Debug, Clone, Serialize, Deserialize)]
606#[serde(untagged)]
607pub enum ListProtectionRulesError {
608    UnknownValue(serde_json::Value),
609}
610
611/// struct for typed errors of method [`list_shared_ui`]
612#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(untagged)]
614pub enum ListSharedUiError {
615    UnknownValue(serde_json::Value),
616}
617
618/// struct for typed errors of method [`list_user_workspaces`]
619#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum ListUserWorkspacesError {
622    UnknownValue(serde_json::Value),
623}
624
625/// struct for typed errors of method [`list_workspaces`]
626#[derive(Debug, Clone, Serialize, Deserialize)]
627#[serde(untagged)]
628pub enum ListWorkspacesError {
629    UnknownValue(serde_json::Value),
630}
631
632/// struct for typed errors of method [`list_workspaces_as_super_admin`]
633#[derive(Debug, Clone, Serialize, Deserialize)]
634#[serde(untagged)]
635pub enum ListWorkspacesAsSuperAdminError {
636    UnknownValue(serde_json::Value),
637}
638
639/// struct for typed errors of method [`log_ai_chat`]
640#[derive(Debug, Clone, Serialize, Deserialize)]
641#[serde(untagged)]
642pub enum LogAiChatError {
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`prune_versions`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum PruneVersionsError {
650    UnknownValue(serde_json::Value),
651}
652
653/// struct for typed errors of method [`rebuild_dependency_map`]
654#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum RebuildDependencyMapError {
657    UnknownValue(serde_json::Value),
658}
659
660/// struct for typed errors of method [`reset_diff_tally`]
661#[derive(Debug, Clone, Serialize, Deserialize)]
662#[serde(untagged)]
663pub enum ResetDiffTallyError {
664    UnknownValue(serde_json::Value),
665}
666
667/// struct for typed errors of method [`run_slack_message_test_job`]
668#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum RunSlackMessageTestJobError {
671    UnknownValue(serde_json::Value),
672}
673
674/// struct for typed errors of method [`run_teams_message_test_job`]
675#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum RunTeamsMessageTestJobError {
678    UnknownValue(serde_json::Value),
679}
680
681/// struct for typed errors of method [`set_environment_variable`]
682#[derive(Debug, Clone, Serialize, Deserialize)]
683#[serde(untagged)]
684pub enum SetEnvironmentVariableError {
685    UnknownValue(serde_json::Value),
686}
687
688/// struct for typed errors of method [`set_threshold_alert`]
689#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(untagged)]
691pub enum SetThresholdAlertError {
692    UnknownValue(serde_json::Value),
693}
694
695/// struct for typed errors of method [`set_workspace_encryption_key`]
696#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum SetWorkspaceEncryptionKeyError {
699    UnknownValue(serde_json::Value),
700}
701
702/// struct for typed errors of method [`set_workspace_slack_oauth_config`]
703#[derive(Debug, Clone, Serialize, Deserialize)]
704#[serde(untagged)]
705pub enum SetWorkspaceSlackOauthConfigError {
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`unarchive_workspace`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum UnarchiveWorkspaceError {
713    UnknownValue(serde_json::Value),
714}
715
716/// struct for typed errors of method [`update_operator_settings`]
717#[derive(Debug, Clone, Serialize, Deserialize)]
718#[serde(untagged)]
719pub enum UpdateOperatorSettingsError {
720    UnknownValue(serde_json::Value),
721}
722
723/// struct for typed errors of method [`update_protection_rule`]
724#[derive(Debug, Clone, Serialize, Deserialize)]
725#[serde(untagged)]
726pub enum UpdateProtectionRuleError {
727    Status404(),
728    UnknownValue(serde_json::Value),
729}
730
731/// struct for typed errors of method [`update_shared_ui`]
732#[derive(Debug, Clone, Serialize, Deserialize)]
733#[serde(untagged)]
734pub enum UpdateSharedUiError {
735    UnknownValue(serde_json::Value),
736}
737
738
739pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
740    let local_var_configuration = configuration;
741
742    let local_var_client = &local_var_configuration.client;
743
744    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
745    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
746
747    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
748        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
749    }
750    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
751        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
752    };
753    local_var_req_builder = local_var_req_builder.json(&add_user_request);
754
755    let local_var_req = local_var_req_builder.build()?;
756    let local_var_resp = local_var_client.execute(local_var_req).await?;
757
758    let local_var_status = local_var_resp.status();
759    let local_var_content = local_var_resp.text().await?;
760
761    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
762        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
763    } else {
764        let local_var_entity: Option<AddUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
765        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
766        Err(Error::ResponseError(local_var_error))
767    }
768}
769
770pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
771    let local_var_configuration = configuration;
772
773    let local_var_client = &local_var_configuration.client;
774
775    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
776    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
777
778    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
779        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
780    }
781    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
782        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
783    };
784
785    let local_var_req = local_var_req_builder.build()?;
786    let local_var_resp = local_var_client.execute(local_var_req).await?;
787
788    let local_var_status = local_var_resp.status();
789    let local_var_content = local_var_resp.text().await?;
790
791    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
792        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
793    } else {
794        let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
795        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
796        Err(Error::ResponseError(local_var_error))
797    }
798}
799
800pub async fn cancel_deployment_request(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CancelDeploymentRequestError>> {
801    let local_var_configuration = configuration;
802
803    let local_var_client = &local_var_configuration.client;
804
805    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/cancel", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
806    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
807
808    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
809        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
810    }
811    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
812        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
813    };
814
815    let local_var_req = local_var_req_builder.build()?;
816    let local_var_resp = local_var_client.execute(local_var_req).await?;
817
818    let local_var_status = local_var_resp.status();
819    let local_var_content = local_var_resp.text().await?;
820
821    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
822        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
823    } else {
824        let local_var_entity: Option<CancelDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
825        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
826        Err(Error::ResponseError(local_var_error))
827    }
828}
829
830pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
831    let local_var_configuration = configuration;
832
833    let local_var_client = &local_var_configuration.client;
834
835    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
836    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
837
838    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
839        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
840    }
841    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
842        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
843    };
844    local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
845
846    let local_var_req = local_var_req_builder.build()?;
847    let local_var_resp = local_var_client.execute(local_var_req).await?;
848
849    let local_var_status = local_var_resp.status();
850    let local_var_content = local_var_resp.text().await?;
851
852    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
853        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
854    } else {
855        let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
856        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
857        Err(Error::ResponseError(local_var_error))
858    }
859}
860
861pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
862    let local_var_configuration = configuration;
863
864    let local_var_client = &local_var_configuration.client;
865
866    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
867    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
868
869    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
870        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
871    }
872    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
873        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
874    };
875    local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
876
877    let local_var_req = local_var_req_builder.build()?;
878    let local_var_resp = local_var_client.execute(local_var_req).await?;
879
880    let local_var_status = local_var_resp.status();
881    let local_var_content = local_var_resp.text().await?;
882
883    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
884        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
885    } else {
886        let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
887        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
888        Err(Error::ResponseError(local_var_error))
889    }
890}
891
892pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
893    let local_var_configuration = configuration;
894
895    let local_var_client = &local_var_configuration.client;
896
897    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
898    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
899
900    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
901        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
902    }
903    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
904        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
905    };
906    local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
907
908    let local_var_req = local_var_req_builder.build()?;
909    let local_var_resp = local_var_client.execute(local_var_req).await?;
910
911    let local_var_status = local_var_resp.status();
912    let local_var_content = local_var_resp.text().await?;
913
914    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
915        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
916    } else {
917        let local_var_entity: Option<ChangeWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
918        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
919        Err(Error::ResponseError(local_var_error))
920    }
921}
922
923/// Called by the UI after the deploy loop completes. Closes the request and marks every comment obsolete. Idempotent.
924pub async fn close_deployment_request_merged(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CloseDeploymentRequestMergedError>> {
925    let local_var_configuration = configuration;
926
927    let local_var_client = &local_var_configuration.client;
928
929    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);
930    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
931
932    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
933        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
934    }
935    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
936        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
937    };
938
939    let local_var_req = local_var_req_builder.build()?;
940    let local_var_resp = local_var_client.execute(local_var_req).await?;
941
942    let local_var_status = local_var_resp.status();
943    let local_var_content = local_var_resp.text().await?;
944
945    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
946        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
947    } else {
948        let local_var_entity: Option<CloseDeploymentRequestMergedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
949        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
950        Err(Error::ResponseError(local_var_error))
951    }
952}
953
954/// 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.
955pub async fn compare_workspaces(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::WorkspaceComparison, Error<CompareWorkspacesError>> {
956    let local_var_configuration = configuration;
957
958    let local_var_client = &local_var_configuration.client;
959
960    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));
961    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
962
963    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
964        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
965    }
966    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
967        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
968    };
969
970    let local_var_req = local_var_req_builder.build()?;
971    let local_var_resp = local_var_client.execute(local_var_req).await?;
972
973    let local_var_status = local_var_resp.status();
974    let local_var_content = local_var_resp.text().await?;
975
976    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
977        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
978    } else {
979        let local_var_entity: Option<CompareWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
980        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
981        Err(Error::ResponseError(local_var_error))
982    }
983}
984
985pub async fn connect_slack(configuration: &configuration::Configuration, workspace: &str, connect_slack_request: models::ConnectSlackRequest) -> Result<(), Error<ConnectSlackError>> {
986    let local_var_configuration = configuration;
987
988    let local_var_client = &local_var_configuration.client;
989
990    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_slack", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
991    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
992
993    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
994        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
995    }
996    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
997        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
998    };
999    local_var_req_builder = local_var_req_builder.json(&connect_slack_request);
1000
1001    let local_var_req = local_var_req_builder.build()?;
1002    let local_var_resp = local_var_client.execute(local_var_req).await?;
1003
1004    let local_var_status = local_var_resp.status();
1005    let local_var_content = local_var_resp.text().await?;
1006
1007    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1008        Ok(())
1009    } else {
1010        let local_var_entity: Option<ConnectSlackError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1011        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1012        Err(Error::ResponseError(local_var_error))
1013    }
1014}
1015
1016pub async fn connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
1017    let local_var_configuration = configuration;
1018
1019    let local_var_client = &local_var_configuration.client;
1020
1021    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1022    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1023
1024    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1025        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1026    }
1027    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1028        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1029    };
1030    local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
1031
1032    let local_var_req = local_var_req_builder.build()?;
1033    let local_var_resp = local_var_client.execute(local_var_req).await?;
1034
1035    let local_var_status = local_var_resp.status();
1036    let local_var_content = local_var_resp.text().await?;
1037
1038    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1039        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1040    } else {
1041        let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1042        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1043        Err(Error::ResponseError(local_var_error))
1044    }
1045}
1046
1047pub async fn create_deployment_request(configuration: &configuration::Configuration, workspace: &str, create_deployment_request_request: models::CreateDeploymentRequestRequest) -> Result<models::DeploymentRequest, Error<CreateDeploymentRequestError>> {
1048    let local_var_configuration = configuration;
1049
1050    let local_var_client = &local_var_configuration.client;
1051
1052    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1053    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1054
1055    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1056        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1057    }
1058    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1059        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1060    };
1061    local_var_req_builder = local_var_req_builder.json(&create_deployment_request_request);
1062
1063    let local_var_req = local_var_req_builder.build()?;
1064    let local_var_resp = local_var_client.execute(local_var_req).await?;
1065
1066    let local_var_status = local_var_resp.status();
1067    let local_var_content = local_var_resp.text().await?;
1068
1069    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1070        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1071    } else {
1072        let local_var_entity: Option<CreateDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1073        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1074        Err(Error::ResponseError(local_var_error))
1075    }
1076}
1077
1078pub 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>> {
1079    let local_var_configuration = configuration;
1080
1081    let local_var_client = &local_var_configuration.client;
1082
1083    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/comment", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
1084    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1085
1086    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1087        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1088    }
1089    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1090        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1091    };
1092    local_var_req_builder = local_var_req_builder.json(&create_deployment_request_comment_request);
1093
1094    let local_var_req = local_var_req_builder.build()?;
1095    let local_var_resp = local_var_client.execute(local_var_req).await?;
1096
1097    let local_var_status = local_var_resp.status();
1098    let local_var_content = local_var_resp.text().await?;
1099
1100    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1101        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1102    } else {
1103        let local_var_entity: Option<CreateDeploymentRequestCommentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1104        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1105        Err(Error::ResponseError(local_var_error))
1106    }
1107}
1108
1109pub async fn create_pg_database(configuration: &configuration::Configuration, workspace: &str, create_pg_database_request: models::CreatePgDatabaseRequest) -> Result<String, Error<CreatePgDatabaseError>> {
1110    let local_var_configuration = configuration;
1111
1112    let local_var_client = &local_var_configuration.client;
1113
1114    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1115    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1116
1117    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1118        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1119    }
1120    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1121        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1122    };
1123    local_var_req_builder = local_var_req_builder.json(&create_pg_database_request);
1124
1125    let local_var_req = local_var_req_builder.build()?;
1126    let local_var_resp = local_var_client.execute(local_var_req).await?;
1127
1128    let local_var_status = local_var_resp.status();
1129    let local_var_content = local_var_resp.text().await?;
1130
1131    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1132        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1133    } else {
1134        let local_var_entity: Option<CreatePgDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1135        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1136        Err(Error::ResponseError(local_var_error))
1137    }
1138}
1139
1140pub async fn create_protection_rule(configuration: &configuration::Configuration, workspace: &str, create_protection_rule_request: models::CreateProtectionRuleRequest) -> Result<String, Error<CreateProtectionRuleError>> {
1141    let local_var_configuration = configuration;
1142
1143    let local_var_client = &local_var_configuration.client;
1144
1145    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1146    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1147
1148    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1149        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1150    }
1151    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1152        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1153    };
1154    local_var_req_builder = local_var_req_builder.json(&create_protection_rule_request);
1155
1156    let local_var_req = local_var_req_builder.build()?;
1157    let local_var_resp = local_var_client.execute(local_var_req).await?;
1158
1159    let local_var_status = local_var_resp.status();
1160    let local_var_content = local_var_resp.text().await?;
1161
1162    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1163        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1164    } else {
1165        let local_var_entity: Option<CreateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1166        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1167        Err(Error::ResponseError(local_var_error))
1168    }
1169}
1170
1171pub async fn create_service_account(configuration: &configuration::Configuration, workspace: &str, create_service_account_request: models::CreateServiceAccountRequest) -> Result<String, Error<CreateServiceAccountError>> {
1172    let local_var_configuration = configuration;
1173
1174    let local_var_client = &local_var_configuration.client;
1175
1176    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_service_account", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1177    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1178
1179    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1180        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1181    }
1182    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1183        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1184    };
1185    local_var_req_builder = local_var_req_builder.json(&create_service_account_request);
1186
1187    let local_var_req = local_var_req_builder.build()?;
1188    let local_var_resp = local_var_client.execute(local_var_req).await?;
1189
1190    let local_var_status = local_var_resp.status();
1191    let local_var_content = local_var_resp.text().await?;
1192
1193    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1194        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1195    } else {
1196        let local_var_entity: Option<CreateServiceAccountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1197        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1198        Err(Error::ResponseError(local_var_error))
1199    }
1200}
1201
1202pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
1203    let local_var_configuration = configuration;
1204
1205    let local_var_client = &local_var_configuration.client;
1206
1207    let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
1208    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1209
1210    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1211        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1212    }
1213    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1214        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1215    };
1216    local_var_req_builder = local_var_req_builder.json(&create_workspace);
1217
1218    let local_var_req = local_var_req_builder.build()?;
1219    let local_var_resp = local_var_client.execute(local_var_req).await?;
1220
1221    let local_var_status = local_var_resp.status();
1222    let local_var_content = local_var_resp.text().await?;
1223
1224    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1225        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1226    } else {
1227        let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1228        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1229        Err(Error::ResponseError(local_var_error))
1230    }
1231}
1232
1233pub async fn create_workspace_fork(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<String, Error<CreateWorkspaceForkError>> {
1234    let local_var_configuration = configuration;
1235
1236    let local_var_client = &local_var_configuration.client;
1237
1238    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_fork", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1239    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1240
1241    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1242        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1243    }
1244    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1245        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1246    };
1247    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1248
1249    let local_var_req = local_var_req_builder.build()?;
1250    let local_var_resp = local_var_client.execute(local_var_req).await?;
1251
1252    let local_var_status = local_var_resp.status();
1253    let local_var_content = local_var_resp.text().await?;
1254
1255    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1256        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1257    } else {
1258        let local_var_entity: Option<CreateWorkspaceForkError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1259        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1260        Err(Error::ResponseError(local_var_error))
1261    }
1262}
1263
1264pub async fn create_workspace_fork_git_branch(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<Vec<uuid::Uuid>, Error<CreateWorkspaceForkGitBranchError>> {
1265    let local_var_configuration = configuration;
1266
1267    let local_var_client = &local_var_configuration.client;
1268
1269    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_workspace_fork_branch", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1270    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1271
1272    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1273        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1274    }
1275    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1276        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1277    };
1278    local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1279
1280    let local_var_req = local_var_req_builder.build()?;
1281    let local_var_resp = local_var_client.execute(local_var_req).await?;
1282
1283    let local_var_status = local_var_resp.status();
1284    let local_var_content = local_var_resp.text().await?;
1285
1286    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1287        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1288    } else {
1289        let local_var_entity: Option<CreateWorkspaceForkGitBranchError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1290        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1291        Err(Error::ResponseError(local_var_error))
1292    }
1293}
1294
1295pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
1296    let local_var_configuration = configuration;
1297
1298    let local_var_client = &local_var_configuration.client;
1299
1300    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1301    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1302
1303    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1304        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1305    }
1306    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1307        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1308    };
1309    local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
1310
1311    let local_var_req = local_var_req_builder.build()?;
1312    let local_var_resp = local_var_client.execute(local_var_req).await?;
1313
1314    let local_var_status = local_var_resp.status();
1315    let local_var_content = local_var_resp.text().await?;
1316
1317    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1318        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1319    } else {
1320        let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1321        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1322        Err(Error::ResponseError(local_var_error))
1323    }
1324}
1325
1326pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, delete_invite_request: models::DeleteInviteRequest) -> Result<String, Error<DeleteInviteError>> {
1327    let local_var_configuration = configuration;
1328
1329    let local_var_client = &local_var_configuration.client;
1330
1331    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1332    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1333
1334    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1335        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1336    }
1337    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1338        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1339    };
1340    local_var_req_builder = local_var_req_builder.json(&delete_invite_request);
1341
1342    let local_var_req = local_var_req_builder.build()?;
1343    let local_var_resp = local_var_client.execute(local_var_req).await?;
1344
1345    let local_var_status = local_var_resp.status();
1346    let local_var_content = local_var_resp.text().await?;
1347
1348    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1349        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1350    } else {
1351        let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1352        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1353        Err(Error::ResponseError(local_var_error))
1354    }
1355}
1356
1357pub async fn delete_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str) -> Result<String, Error<DeleteProtectionRuleError>> {
1358    let local_var_configuration = configuration;
1359
1360    let local_var_client = &local_var_configuration.client;
1361
1362    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));
1363    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1364
1365    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1366        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1367    }
1368    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1369        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1370    };
1371
1372    let local_var_req = local_var_req_builder.build()?;
1373    let local_var_resp = local_var_client.execute(local_var_req).await?;
1374
1375    let local_var_status = local_var_resp.status();
1376    let local_var_content = local_var_resp.text().await?;
1377
1378    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1379        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1380    } else {
1381        let local_var_entity: Option<DeleteProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1382        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1383        Err(Error::ResponseError(local_var_error))
1384    }
1385}
1386
1387pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str, only_delete_forks: Option<bool>) -> Result<String, Error<DeleteWorkspaceError>> {
1388    let local_var_configuration = configuration;
1389
1390    let local_var_client = &local_var_configuration.client;
1391
1392    let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1393    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1394
1395    if let Some(ref local_var_str) = only_delete_forks {
1396        local_var_req_builder = local_var_req_builder.query(&[("only_delete_forks", &local_var_str.to_string())]);
1397    }
1398    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1399        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1400    }
1401    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1402        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1403    };
1404
1405    let local_var_req = local_var_req_builder.build()?;
1406    let local_var_resp = local_var_client.execute(local_var_req).await?;
1407
1408    let local_var_status = local_var_resp.status();
1409    let local_var_content = local_var_resp.text().await?;
1410
1411    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1412        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1413    } else {
1414        let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1415        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1416        Err(Error::ResponseError(local_var_error))
1417    }
1418}
1419
1420pub async fn delete_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceSlackOauthConfigError>> {
1421    let local_var_configuration = configuration;
1422
1423    let local_var_client = &local_var_configuration.client;
1424
1425    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1426    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1427
1428    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1429        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1430    }
1431    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1432        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1433    };
1434
1435    let local_var_req = local_var_req_builder.build()?;
1436    let local_var_resp = local_var_client.execute(local_var_req).await?;
1437
1438    let local_var_status = local_var_resp.status();
1439    let local_var_content = local_var_resp.text().await?;
1440
1441    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1442        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1443    } else {
1444        let local_var_entity: Option<DeleteWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1445        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1446        Err(Error::ResponseError(local_var_error))
1447    }
1448}
1449
1450pub async fn drop_forked_datatable_databases(configuration: &configuration::Configuration, workspace: &str, drop_forked_datatable_databases_request: models::DropForkedDatatableDatabasesRequest) -> Result<Vec<String>, Error<DropForkedDatatableDatabasesError>> {
1451    let local_var_configuration = configuration;
1452
1453    let local_var_client = &local_var_configuration.client;
1454
1455    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/drop_forked_datatable_databases", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1456    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1457
1458    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1459        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1460    }
1461    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1462        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1463    };
1464    local_var_req_builder = local_var_req_builder.json(&drop_forked_datatable_databases_request);
1465
1466    let local_var_req = local_var_req_builder.build()?;
1467    let local_var_resp = local_var_client.execute(local_var_req).await?;
1468
1469    let local_var_status = local_var_resp.status();
1470    let local_var_content = local_var_resp.text().await?;
1471
1472    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1473        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1474    } else {
1475        let local_var_entity: Option<DropForkedDatatableDatabasesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1476        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1477        Err(Error::ResponseError(local_var_error))
1478    }
1479}
1480
1481pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
1482    let local_var_configuration = configuration;
1483
1484    let local_var_client = &local_var_configuration.client;
1485
1486    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1487    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1488
1489    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1490        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1491    }
1492    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1493        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1494    };
1495    local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
1496
1497    let local_var_req = local_var_req_builder.build()?;
1498    let local_var_resp = local_var_client.execute(local_var_req).await?;
1499
1500    let local_var_status = local_var_resp.status();
1501    let local_var_content = local_var_resp.text().await?;
1502
1503    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1504        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1505    } else {
1506        let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1507        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1508        Err(Error::ResponseError(local_var_error))
1509    }
1510}
1511
1512pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<models::EditCopilotConfig200Response, Error<EditCopilotConfigError>> {
1513    let local_var_configuration = configuration;
1514
1515    let local_var_client = &local_var_configuration.client;
1516
1517    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1518    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1519
1520    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1521        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1522    }
1523    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1524        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1525    };
1526    local_var_req_builder = local_var_req_builder.json(&ai_config);
1527
1528    let local_var_req = local_var_req_builder.build()?;
1529    let local_var_resp = local_var_client.execute(local_var_req).await?;
1530
1531    let local_var_status = local_var_resp.status();
1532    let local_var_content = local_var_resp.text().await?;
1533
1534    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1535        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1536    } else {
1537        let local_var_entity: Option<EditCopilotConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1538        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1539        Err(Error::ResponseError(local_var_error))
1540    }
1541}
1542
1543pub async fn edit_data_table_config(configuration: &configuration::Configuration, workspace: &str, edit_data_table_config_request: models::EditDataTableConfigRequest) -> Result<serde_json::Value, Error<EditDataTableConfigError>> {
1544    let local_var_configuration = configuration;
1545
1546    let local_var_client = &local_var_configuration.client;
1547
1548    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_datatable_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1549    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1550
1551    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1552        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1553    }
1554    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1555        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1556    };
1557    local_var_req_builder = local_var_req_builder.json(&edit_data_table_config_request);
1558
1559    let local_var_req = local_var_req_builder.build()?;
1560    let local_var_resp = local_var_client.execute(local_var_req).await?;
1561
1562    let local_var_status = local_var_resp.status();
1563    let local_var_content = local_var_resp.text().await?;
1564
1565    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1566        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1567    } else {
1568        let local_var_entity: Option<EditDataTableConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1569        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1570        Err(Error::ResponseError(local_var_error))
1571    }
1572}
1573
1574pub async fn edit_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
1575    let local_var_configuration = configuration;
1576
1577    let local_var_client = &local_var_configuration.client;
1578
1579    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1580    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1581
1582    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1583        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1584    }
1585    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1586        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1587    };
1588    local_var_req_builder = local_var_req_builder.json(&workspace_default_scripts);
1589
1590    let local_var_req = local_var_req_builder.build()?;
1591    let local_var_resp = local_var_client.execute(local_var_req).await?;
1592
1593    let local_var_status = local_var_resp.status();
1594    let local_var_content = local_var_resp.text().await?;
1595
1596    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1597        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1598    } else {
1599        let local_var_entity: Option<EditDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1600        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1601        Err(Error::ResponseError(local_var_error))
1602    }
1603}
1604
1605pub async fn edit_deploy_to(configuration: &configuration::Configuration, workspace: &str, get_deploy_to200_response: models::GetDeployTo200Response) -> Result<String, Error<EditDeployToError>> {
1606    let local_var_configuration = configuration;
1607
1608    let local_var_client = &local_var_configuration.client;
1609
1610    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1611    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1612
1613    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1614        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1615    }
1616    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1617        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1618    };
1619    local_var_req_builder = local_var_req_builder.json(&get_deploy_to200_response);
1620
1621    let local_var_req = local_var_req_builder.build()?;
1622    let local_var_resp = local_var_client.execute(local_var_req).await?;
1623
1624    let local_var_status = local_var_resp.status();
1625    let local_var_content = local_var_resp.text().await?;
1626
1627    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1628        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1629    } else {
1630        let local_var_entity: Option<EditDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1631        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1632        Err(Error::ResponseError(local_var_error))
1633    }
1634}
1635
1636pub async fn edit_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
1637    let local_var_configuration = configuration;
1638
1639    let local_var_client = &local_var_configuration.client;
1640
1641    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_ducklake_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1642    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1643
1644    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1645        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1646    }
1647    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1648        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1649    };
1650    local_var_req_builder = local_var_req_builder.json(&edit_ducklake_config_request);
1651
1652    let local_var_req = local_var_req_builder.build()?;
1653    let local_var_resp = local_var_client.execute(local_var_req).await?;
1654
1655    let local_var_status = local_var_resp.status();
1656    let local_var_content = local_var_resp.text().await?;
1657
1658    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1659        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1660    } else {
1661        let local_var_entity: Option<EditDucklakeConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1662        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1663        Err(Error::ResponseError(local_var_error))
1664    }
1665}
1666
1667pub async fn edit_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler: models::EditErrorHandler) -> Result<String, Error<EditErrorHandlerError>> {
1668    let local_var_configuration = configuration;
1669
1670    let local_var_client = &local_var_configuration.client;
1671
1672    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_error_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1673    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1674
1675    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1676        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1677    }
1678    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1679        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1680    };
1681    local_var_req_builder = local_var_req_builder.json(&edit_error_handler);
1682
1683    let local_var_req = local_var_req_builder.build()?;
1684    let local_var_resp = local_var_client.execute(local_var_req).await?;
1685
1686    let local_var_status = local_var_resp.status();
1687    let local_var_content = local_var_resp.text().await?;
1688
1689    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1690        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1691    } else {
1692        let local_var_entity: Option<EditErrorHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1693        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1694        Err(Error::ResponseError(local_var_error))
1695    }
1696}
1697
1698pub async fn edit_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
1699    let local_var_configuration = configuration;
1700
1701    let local_var_client = &local_var_configuration.client;
1702
1703    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1704    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1705
1706    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1707        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1708    }
1709    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1710        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1711    };
1712    local_var_req_builder = local_var_req_builder.json(&edit_git_sync_repository_request);
1713
1714    let local_var_req = local_var_req_builder.build()?;
1715    let local_var_resp = local_var_client.execute(local_var_req).await?;
1716
1717    let local_var_status = local_var_resp.status();
1718    let local_var_content = local_var_resp.text().await?;
1719
1720    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1721        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1722    } else {
1723        let local_var_entity: Option<EditGitSyncRepositoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1724        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1725        Err(Error::ResponseError(local_var_error))
1726    }
1727}
1728
1729pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
1730    let local_var_configuration = configuration;
1731
1732    let local_var_client = &local_var_configuration.client;
1733
1734    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1735    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1736
1737    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1738        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1739    }
1740    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1741        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1742    };
1743    local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
1744
1745    let local_var_req = local_var_req_builder.build()?;
1746    let local_var_resp = local_var_client.execute(local_var_req).await?;
1747
1748    let local_var_status = local_var_resp.status();
1749    let local_var_content = local_var_resp.text().await?;
1750
1751    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1752        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1753    } else {
1754        let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1755        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1756        Err(Error::ResponseError(local_var_error))
1757    }
1758}
1759
1760pub 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>> {
1761    let local_var_configuration = configuration;
1762
1763    let local_var_client = &local_var_configuration.client;
1764
1765    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1766    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1767
1768    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1769        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1770    }
1771    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1772        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1773    };
1774    local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
1775
1776    let local_var_req = local_var_req_builder.build()?;
1777    let local_var_resp = local_var_client.execute(local_var_req).await?;
1778
1779    let local_var_status = local_var_resp.status();
1780    let local_var_content = local_var_resp.text().await?;
1781
1782    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1783        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1784    } else {
1785        let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1786        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1787        Err(Error::ResponseError(local_var_error))
1788    }
1789}
1790
1791pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
1792    let local_var_configuration = configuration;
1793
1794    let local_var_client = &local_var_configuration.client;
1795
1796    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1797    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1798
1799    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1800        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1801    }
1802    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1803        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1804    };
1805    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1806
1807    let local_var_req = local_var_req_builder.build()?;
1808    let local_var_resp = local_var_client.execute(local_var_req).await?;
1809
1810    let local_var_status = local_var_resp.status();
1811    let local_var_content = local_var_resp.text().await?;
1812
1813    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1814        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1815    } else {
1816        let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1817        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1818        Err(Error::ResponseError(local_var_error))
1819    }
1820}
1821
1822pub async fn edit_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler: models::EditSuccessHandler) -> Result<String, Error<EditSuccessHandlerError>> {
1823    let local_var_configuration = configuration;
1824
1825    let local_var_client = &local_var_configuration.client;
1826
1827    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_success_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1828    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1829
1830    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1831        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1832    }
1833    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1834        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1835    };
1836    local_var_req_builder = local_var_req_builder.json(&edit_success_handler);
1837
1838    let local_var_req = local_var_req_builder.build()?;
1839    let local_var_resp = local_var_client.execute(local_var_req).await?;
1840
1841    let local_var_status = local_var_resp.status();
1842    let local_var_content = local_var_resp.text().await?;
1843
1844    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1845        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1846    } else {
1847        let local_var_entity: Option<EditSuccessHandlerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1848        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1849        Err(Error::ResponseError(local_var_error))
1850    }
1851}
1852
1853pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
1854    let local_var_configuration = configuration;
1855
1856    let local_var_client = &local_var_configuration.client;
1857
1858    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1859    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1860
1861    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1862        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1863    }
1864    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1865        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1866    };
1867    local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1868
1869    let local_var_req = local_var_req_builder.build()?;
1870    let local_var_resp = local_var_client.execute(local_var_req).await?;
1871
1872    let local_var_status = local_var_resp.status();
1873    let local_var_content = local_var_resp.text().await?;
1874
1875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1876        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1877    } else {
1878        let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1880        Err(Error::ResponseError(local_var_error))
1881    }
1882}
1883
1884pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
1885    let local_var_configuration = configuration;
1886
1887    let local_var_client = &local_var_configuration.client;
1888
1889    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1890    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1891
1892    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1893        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1894    }
1895    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1896        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1897    };
1898    local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
1899
1900    let local_var_req = local_var_req_builder.build()?;
1901    let local_var_resp = local_var_client.execute(local_var_req).await?;
1902
1903    let local_var_status = local_var_resp.status();
1904    let local_var_content = local_var_resp.text().await?;
1905
1906    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1907        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1908    } else {
1909        let local_var_entity: Option<EditWebhookError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1910        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1911        Err(Error::ResponseError(local_var_error))
1912    }
1913}
1914
1915pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
1916    let local_var_configuration = configuration;
1917
1918    let local_var_client = &local_var_configuration.client;
1919
1920    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1921    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1922
1923    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1924        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1925    }
1926    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1927        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1928    };
1929    local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
1930
1931    let local_var_req = local_var_req_builder.build()?;
1932    let local_var_resp = local_var_client.execute(local_var_req).await?;
1933
1934    let local_var_status = local_var_resp.status();
1935    let local_var_content = local_var_resp.text().await?;
1936
1937    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1938        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1939    } else {
1940        let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1941        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1942        Err(Error::ResponseError(local_var_error))
1943    }
1944}
1945
1946pub 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>> {
1947    let local_var_configuration = configuration;
1948
1949    let local_var_client = &local_var_configuration.client;
1950
1951    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1952    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1953
1954    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1955        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1956    }
1957    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1958        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1959    };
1960    local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
1961
1962    let local_var_req = local_var_req_builder.build()?;
1963    let local_var_resp = local_var_client.execute(local_var_req).await?;
1964
1965    let local_var_status = local_var_resp.status();
1966    let local_var_content = local_var_resp.text().await?;
1967
1968    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1969        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1970    } else {
1971        let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1972        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1973        Err(Error::ResponseError(local_var_error))
1974    }
1975}
1976
1977pub 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>> {
1978    let local_var_configuration = configuration;
1979
1980    let local_var_client = &local_var_configuration.client;
1981
1982    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1983    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1984
1985    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1986        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1987    }
1988    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1989        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1990    };
1991    local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
1992
1993    let local_var_req = local_var_req_builder.build()?;
1994    let local_var_resp = local_var_client.execute(local_var_req).await?;
1995
1996    let local_var_status = local_var_resp.status();
1997    let local_var_content = local_var_resp.text().await?;
1998
1999    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2000        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2001    } else {
2002        let local_var_entity: Option<EditWorkspaceGitSyncConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2003        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2004        Err(Error::ResponseError(local_var_error))
2005    }
2006}
2007
2008pub async fn exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
2009    let local_var_configuration = configuration;
2010
2011    let local_var_client = &local_var_configuration.client;
2012
2013    let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
2014    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2015
2016    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2017        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2018    }
2019    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2020        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2021    };
2022    local_var_req_builder = local_var_req_builder.json(&exists_username_request);
2023
2024    let local_var_req = local_var_req_builder.build()?;
2025    let local_var_resp = local_var_client.execute(local_var_req).await?;
2026
2027    let local_var_status = local_var_resp.status();
2028    let local_var_content = local_var_resp.text().await?;
2029
2030    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2031        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2032    } else {
2033        let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2034        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2035        Err(Error::ResponseError(local_var_error))
2036    }
2037}
2038
2039pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
2040    let local_var_configuration = configuration;
2041
2042    let local_var_client = &local_var_configuration.client;
2043
2044    let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
2045    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2046
2047    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2048        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2049    }
2050    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2051        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2052    };
2053    local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
2054
2055    let local_var_req = local_var_req_builder.build()?;
2056    let local_var_resp = local_var_client.execute(local_var_req).await?;
2057
2058    let local_var_status = local_var_resp.status();
2059    let local_var_content = local_var_resp.text().await?;
2060
2061    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2062        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2063    } else {
2064        let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2065        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2066        Err(Error::ResponseError(local_var_error))
2067    }
2068}
2069
2070pub async fn export_pg_schema(configuration: &configuration::Configuration, workspace: &str, export_pg_schema_request: models::ExportPgSchemaRequest) -> Result<String, Error<ExportPgSchemaError>> {
2071    let local_var_configuration = configuration;
2072
2073    let local_var_client = &local_var_configuration.client;
2074
2075    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/export_pg_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2076    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2077
2078    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2079        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2080    }
2081    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2082        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2083    };
2084    local_var_req_builder = local_var_req_builder.json(&export_pg_schema_request);
2085
2086    let local_var_req = local_var_req_builder.build()?;
2087    let local_var_resp = local_var_client.execute(local_var_req).await?;
2088
2089    let local_var_status = local_var_resp.status();
2090    let local_var_content = local_var_resp.text().await?;
2091
2092    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2093        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2094    } else {
2095        let local_var_entity: Option<ExportPgSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2096        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2097        Err(Error::ResponseError(local_var_error))
2098    }
2099}
2100
2101pub async fn get_cloud_quotas(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCloudQuotas200Response, Error<GetCloudQuotasError>> {
2102    let local_var_configuration = configuration;
2103
2104    let local_var_client = &local_var_configuration.client;
2105
2106    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/cloud_quotas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2107    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2108
2109    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2110        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2111    }
2112    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2113        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2114    };
2115
2116    let local_var_req = local_var_req_builder.build()?;
2117    let local_var_resp = local_var_client.execute(local_var_req).await?;
2118
2119    let local_var_status = local_var_resp.status();
2120    let local_var_content = local_var_resp.text().await?;
2121
2122    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2123        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2124    } else {
2125        let local_var_entity: Option<GetCloudQuotasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2126        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2127        Err(Error::ResponseError(local_var_error))
2128    }
2129}
2130
2131pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
2132    let local_var_configuration = configuration;
2133
2134    let local_var_client = &local_var_configuration.client;
2135
2136    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2137    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2138
2139    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2140        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2141    }
2142    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2143        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2144    };
2145
2146    let local_var_req = local_var_req_builder.build()?;
2147    let local_var_resp = local_var_client.execute(local_var_req).await?;
2148
2149    let local_var_status = local_var_resp.status();
2150    let local_var_content = local_var_resp.text().await?;
2151
2152    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2153        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2154    } else {
2155        let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2156        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2157        Err(Error::ResponseError(local_var_error))
2158    }
2159}
2160
2161pub async fn get_copilot_settings_state(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCopilotSettingsState200Response, Error<GetCopilotSettingsStateError>> {
2162    let local_var_configuration = configuration;
2163
2164    let local_var_client = &local_var_configuration.client;
2165
2166    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_settings_state", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2167    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2168
2169    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2170        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2171    }
2172    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2173        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2174    };
2175
2176    let local_var_req = local_var_req_builder.build()?;
2177    let local_var_resp = local_var_client.execute(local_var_req).await?;
2178
2179    let local_var_status = local_var_resp.status();
2180    let local_var_content = local_var_resp.text().await?;
2181
2182    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2183        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2184    } else {
2185        let local_var_entity: Option<GetCopilotSettingsStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2186        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2187        Err(Error::ResponseError(local_var_error))
2188    }
2189}
2190
2191pub async fn get_data_table_table_schema(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, schema_name: &str, table_name: &str) -> Result<models::DataTableTableSchema, Error<GetDataTableTableSchemaError>> {
2192    let local_var_configuration = configuration;
2193
2194    let local_var_client = &local_var_configuration.client;
2195
2196    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_table_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2197    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2198
2199    local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &datatable_name.to_string())]);
2200    local_var_req_builder = local_var_req_builder.query(&[("schema_name", &schema_name.to_string())]);
2201    local_var_req_builder = local_var_req_builder.query(&[("table_name", &table_name.to_string())]);
2202    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2203        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2204    }
2205    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2206        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2207    };
2208
2209    let local_var_req = local_var_req_builder.build()?;
2210    let local_var_resp = local_var_client.execute(local_var_req).await?;
2211
2212    let local_var_status = local_var_resp.status();
2213    let local_var_content = local_var_resp.text().await?;
2214
2215    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2216        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2217    } else {
2218        let local_var_entity: Option<GetDataTableTableSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2219        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2220        Err(Error::ResponseError(local_var_error))
2221    }
2222}
2223
2224pub 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>> {
2225    let local_var_configuration = configuration;
2226
2227    let local_var_client = &local_var_configuration.client;
2228
2229    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_full_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2230    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2231
2232    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2233        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2234    }
2235    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2236        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2237    };
2238    local_var_req_builder = local_var_req_builder.json(&get_datatable_full_schema_request);
2239
2240    let local_var_req = local_var_req_builder.build()?;
2241    let local_var_resp = local_var_client.execute(local_var_req).await?;
2242
2243    let local_var_status = local_var_resp.status();
2244    let local_var_content = local_var_resp.text().await?;
2245
2246    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2247        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2248    } else {
2249        let local_var_entity: Option<GetDatatableFullSchemaError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2250        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2251        Err(Error::ResponseError(local_var_error))
2252    }
2253}
2254
2255pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
2256    let local_var_configuration = configuration;
2257
2258    let local_var_client = &local_var_configuration.client;
2259
2260    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2261    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2262
2263    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2264        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2265    }
2266    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2267        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2268    };
2269
2270    let local_var_req = local_var_req_builder.build()?;
2271    let local_var_resp = local_var_client.execute(local_var_req).await?;
2272
2273    let local_var_status = local_var_resp.status();
2274    let local_var_content = local_var_resp.text().await?;
2275
2276    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2277        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2278    } else {
2279        let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2280        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2281        Err(Error::ResponseError(local_var_error))
2282    }
2283}
2284
2285pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
2286    let local_var_configuration = configuration;
2287
2288    let local_var_client = &local_var_configuration.client;
2289
2290    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2291    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2292
2293    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2294        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2295    }
2296    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2297        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2298    };
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<GetDependencyMapError> = 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 get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
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/get_dependents/{imported_path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), imported_path=crate::apis::urlencode(imported_path));
2321    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
2330    let local_var_req = local_var_req_builder.build()?;
2331    let local_var_resp = local_var_client.execute(local_var_req).await?;
2332
2333    let local_var_status = local_var_resp.status();
2334    let local_var_content = local_var_resp.text().await?;
2335
2336    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2337        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2338    } else {
2339        let local_var_entity: Option<GetDependentsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2340        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2341        Err(Error::ResponseError(local_var_error))
2342    }
2343}
2344
2345pub async fn get_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
2346    let local_var_configuration = configuration;
2347
2348    let local_var_client = &local_var_configuration.client;
2349
2350    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2351    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2352
2353    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2354        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2355    }
2356    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2357        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2358    };
2359    local_var_req_builder = local_var_req_builder.json(&request_body);
2360
2361    let local_var_req = local_var_req_builder.build()?;
2362    let local_var_resp = local_var_client.execute(local_var_req).await?;
2363
2364    let local_var_status = local_var_resp.status();
2365    let local_var_content = local_var_resp.text().await?;
2366
2367    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2368        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2369    } else {
2370        let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2371        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2372        Err(Error::ResponseError(local_var_error))
2373    }
2374}
2375
2376pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
2377    let local_var_configuration = configuration;
2378
2379    let local_var_client = &local_var_configuration.client;
2380
2381    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2382    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2383
2384    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2385        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2386    }
2387    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2388        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2389    };
2390
2391    let local_var_req = local_var_req_builder.build()?;
2392    let local_var_resp = local_var_client.execute(local_var_req).await?;
2393
2394    let local_var_status = local_var_resp.status();
2395    let local_var_content = local_var_resp.text().await?;
2396
2397    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2398        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2399    } else {
2400        let local_var_entity: Option<GetDeployToError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2401        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2402        Err(Error::ResponseError(local_var_error))
2403    }
2404}
2405
2406pub async fn get_git_sync_enabled(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetGitSyncEnabled200Response, Error<GetGitSyncEnabledError>> {
2407    let local_var_configuration = configuration;
2408
2409    let local_var_client = &local_var_configuration.client;
2410
2411    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_enabled", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2412    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2413
2414    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2415        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2416    }
2417    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2418        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2419    };
2420
2421    let local_var_req = local_var_req_builder.build()?;
2422    let local_var_resp = local_var_client.execute(local_var_req).await?;
2423
2424    let local_var_status = local_var_resp.status();
2425    let local_var_content = local_var_resp.text().await?;
2426
2427    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2428        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2429    } else {
2430        let local_var_entity: Option<GetGitSyncEnabledError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2431        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2432        Err(Error::ResponseError(local_var_error))
2433    }
2434}
2435
2436pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
2437    let local_var_configuration = configuration;
2438
2439    let local_var_client = &local_var_configuration.client;
2440
2441    let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2442    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2443
2444    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2445        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2446    }
2447    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2448        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2449    };
2450    local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
2451
2452    let local_var_req = local_var_req_builder.build()?;
2453    let local_var_resp = local_var_client.execute(local_var_req).await?;
2454
2455    let local_var_status = local_var_resp.status();
2456    let local_var_content = local_var_resp.text().await?;
2457
2458    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2459        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2460    } else {
2461        let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2462        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2463        Err(Error::ResponseError(local_var_error))
2464    }
2465}
2466
2467pub async fn get_imports(configuration: &configuration::Configuration, workspace: &str, importer_path: &str) -> Result<Vec<String>, Error<GetImportsError>> {
2468    let local_var_configuration = configuration;
2469
2470    let local_var_client = &local_var_configuration.client;
2471
2472    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));
2473    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2474
2475    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2476        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2477    }
2478    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2479        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2480    };
2481
2482    let local_var_req = local_var_req_builder.build()?;
2483    let local_var_resp = local_var_client.execute(local_var_req).await?;
2484
2485    let local_var_status = local_var_resp.status();
2486    let local_var_content = local_var_resp.text().await?;
2487
2488    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2489        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2490    } else {
2491        let local_var_entity: Option<GetImportsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2492        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2493        Err(Error::ResponseError(local_var_error))
2494    }
2495}
2496
2497pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
2498    let local_var_configuration = configuration;
2499
2500    let local_var_client = &local_var_configuration.client;
2501
2502    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2503    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2504
2505    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2506        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2507    }
2508    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2509        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2510    };
2511
2512    let local_var_req = local_var_req_builder.build()?;
2513    let local_var_resp = local_var_client.execute(local_var_req).await?;
2514
2515    let local_var_status = local_var_resp.status();
2516    let local_var_content = local_var_resp.text().await?;
2517
2518    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2519        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2520    } else {
2521        let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2522        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2523        Err(Error::ResponseError(local_var_error))
2524    }
2525}
2526
2527pub async fn get_open_deployment_request(configuration: &configuration::Configuration, workspace: &str) -> Result<models::DeploymentRequest, Error<GetOpenDeploymentRequestError>> {
2528    let local_var_configuration = configuration;
2529
2530    let local_var_client = &local_var_configuration.client;
2531
2532    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/open", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2533    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2534
2535    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2536        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2537    }
2538    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2539        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2540    };
2541
2542    let local_var_req = local_var_req_builder.build()?;
2543    let local_var_resp = local_var_client.execute(local_var_req).await?;
2544
2545    let local_var_status = local_var_resp.status();
2546    let local_var_content = local_var_resp.text().await?;
2547
2548    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2549        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2550    } else {
2551        let local_var_entity: Option<GetOpenDeploymentRequestError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2552        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2553        Err(Error::ResponseError(local_var_error))
2554    }
2555}
2556
2557pub async fn get_premium_info(configuration: &configuration::Configuration, workspace: &str, skip_subscription_fetch: Option<bool>) -> Result<models::GetPremiumInfo200Response, Error<GetPremiumInfoError>> {
2558    let local_var_configuration = configuration;
2559
2560    let local_var_client = &local_var_configuration.client;
2561
2562    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/premium_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2563    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2564
2565    if let Some(ref local_var_str) = skip_subscription_fetch {
2566        local_var_req_builder = local_var_req_builder.query(&[("skip_subscription_fetch", &local_var_str.to_string())]);
2567    }
2568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2570    }
2571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2573    };
2574
2575    let local_var_req = local_var_req_builder.build()?;
2576    let local_var_resp = local_var_client.execute(local_var_req).await?;
2577
2578    let local_var_status = local_var_resp.status();
2579    let local_var_content = local_var_resp.text().await?;
2580
2581    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2582        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2583    } else {
2584        let local_var_entity: Option<GetPremiumInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2585        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2586        Err(Error::ResponseError(local_var_error))
2587    }
2588}
2589
2590pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
2591    let local_var_configuration = configuration;
2592
2593    let local_var_client = &local_var_configuration.client;
2594
2595    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2596    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2597
2598    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2599        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2600    }
2601    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2602        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2603    };
2604
2605    let local_var_req = local_var_req_builder.build()?;
2606    let local_var_resp = local_var_client.execute(local_var_req).await?;
2607
2608    let local_var_status = local_var_resp.status();
2609    let local_var_content = local_var_resp.text().await?;
2610
2611    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2612        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2613    } else {
2614        let local_var_entity: Option<GetSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2615        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2616        Err(Error::ResponseError(local_var_error))
2617    }
2618}
2619
2620pub async fn get_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUi200Response, Error<GetSharedUiError>> {
2621    let local_var_configuration = configuration;
2622
2623    let local_var_client = &local_var_configuration.client;
2624
2625    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/get", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2626    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2627
2628    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2629        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2630    }
2631    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2632        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2633    };
2634
2635    let local_var_req = local_var_req_builder.build()?;
2636    let local_var_resp = local_var_client.execute(local_var_req).await?;
2637
2638    let local_var_status = local_var_resp.status();
2639    let local_var_content = local_var_resp.text().await?;
2640
2641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2642        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2643    } else {
2644        let local_var_entity: Option<GetSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2645        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2646        Err(Error::ResponseError(local_var_error))
2647    }
2648}
2649
2650pub async fn get_shared_ui_version(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUiVersion200Response, Error<GetSharedUiVersionError>> {
2651    let local_var_configuration = configuration;
2652
2653    let local_var_client = &local_var_configuration.client;
2654
2655    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/version", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2656    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2657
2658    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2659        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2660    }
2661    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2662        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2663    };
2664
2665    let local_var_req = local_var_req_builder.build()?;
2666    let local_var_resp = local_var_client.execute(local_var_req).await?;
2667
2668    let local_var_status = local_var_resp.status();
2669    let local_var_content = local_var_resp.text().await?;
2670
2671    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2672        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2673    } else {
2674        let local_var_entity: Option<GetSharedUiVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2675        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2676        Err(Error::ResponseError(local_var_error))
2677    }
2678}
2679
2680pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
2681    let local_var_configuration = configuration;
2682
2683    let local_var_client = &local_var_configuration.client;
2684
2685    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2686    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2687
2688    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2689        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2690    }
2691    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2692        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2693    };
2694
2695    let local_var_req = local_var_req_builder.build()?;
2696    let local_var_resp = local_var_client.execute(local_var_req).await?;
2697
2698    let local_var_status = local_var_resp.status();
2699    let local_var_content = local_var_resp.text().await?;
2700
2701    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2702        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2703    } else {
2704        let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2705        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2706        Err(Error::ResponseError(local_var_error))
2707    }
2708}
2709
2710pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
2711    let local_var_configuration = configuration;
2712
2713    let local_var_client = &local_var_configuration.client;
2714
2715    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2716    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2717
2718    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2719        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2720    }
2721    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2722        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2723    };
2724
2725    let local_var_req = local_var_req_builder.build()?;
2726    let local_var_resp = local_var_client.execute(local_var_req).await?;
2727
2728    let local_var_status = local_var_resp.status();
2729    let local_var_content = local_var_resp.text().await?;
2730
2731    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2732        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2733    } else {
2734        let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2735        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2736        Err(Error::ResponseError(local_var_error))
2737    }
2738}
2739
2740pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
2741    let local_var_configuration = configuration;
2742
2743    let local_var_client = &local_var_configuration.client;
2744
2745    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2746    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2747
2748    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2749        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2750    }
2751    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2752        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2753    };
2754
2755    let local_var_req = local_var_req_builder.build()?;
2756    let local_var_resp = local_var_client.execute(local_var_req).await?;
2757
2758    let local_var_status = local_var_resp.status();
2759    let local_var_content = local_var_resp.text().await?;
2760
2761    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2762        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2763    } else {
2764        let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2765        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2766        Err(Error::ResponseError(local_var_error))
2767    }
2768}
2769
2770pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceDefaultApp200Response, Error<GetWorkspaceDefaultAppError>> {
2771    let local_var_configuration = configuration;
2772
2773    let local_var_client = &local_var_configuration.client;
2774
2775    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2776    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2777
2778    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2779        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2780    }
2781    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2782        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2783    };
2784
2785    let local_var_req = local_var_req_builder.build()?;
2786    let local_var_resp = local_var_client.execute(local_var_req).await?;
2787
2788    let local_var_status = local_var_resp.status();
2789    let local_var_content = local_var_resp.text().await?;
2790
2791    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2792        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2793    } else {
2794        let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2795        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2796        Err(Error::ResponseError(local_var_error))
2797    }
2798}
2799
2800pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
2801    let local_var_configuration = configuration;
2802
2803    let local_var_client = &local_var_configuration.client;
2804
2805    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2806    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2807
2808    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2809        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2810    }
2811    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2812        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2813    };
2814
2815    let local_var_req = local_var_req_builder.build()?;
2816    let local_var_resp = local_var_client.execute(local_var_req).await?;
2817
2818    let local_var_status = local_var_resp.status();
2819    let local_var_content = local_var_resp.text().await?;
2820
2821    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2822        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2823    } else {
2824        let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2825        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2826        Err(Error::ResponseError(local_var_error))
2827    }
2828}
2829
2830pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
2831    let local_var_configuration = configuration;
2832
2833    let local_var_client = &local_var_configuration.client;
2834
2835    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2836    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2837
2838    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2839        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2840    }
2841    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2842        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2843    };
2844
2845    let local_var_req = local_var_req_builder.build()?;
2846    let local_var_resp = local_var_client.execute(local_var_req).await?;
2847
2848    let local_var_status = local_var_resp.status();
2849    let local_var_content = local_var_resp.text().await?;
2850
2851    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2852        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2853    } else {
2854        let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2855        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2856        Err(Error::ResponseError(local_var_error))
2857    }
2858}
2859
2860pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
2861    let local_var_configuration = configuration;
2862
2863    let local_var_client = &local_var_configuration.client;
2864
2865    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2866    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2867
2868    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2869        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2870    }
2871    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2872        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2873    };
2874
2875    let local_var_req = local_var_req_builder.build()?;
2876    let local_var_resp = local_var_client.execute(local_var_req).await?;
2877
2878    let local_var_status = local_var_resp.status();
2879    let local_var_content = local_var_resp.text().await?;
2880
2881    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2882        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2883    } else {
2884        let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2885        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2886        Err(Error::ResponseError(local_var_error))
2887    }
2888}
2889
2890pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
2891    let local_var_configuration = configuration;
2892
2893    let local_var_client = &local_var_configuration.client;
2894
2895    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2896    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2897
2898    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2899        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2900    }
2901    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2902        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2903    };
2904
2905    let local_var_req = local_var_req_builder.build()?;
2906    let local_var_resp = local_var_client.execute(local_var_req).await?;
2907
2908    let local_var_status = local_var_resp.status();
2909    let local_var_content = local_var_resp.text().await?;
2910
2911    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2912        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2913    } else {
2914        let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2915        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2916        Err(Error::ResponseError(local_var_error))
2917    }
2918}
2919
2920pub async fn import_pg_database(configuration: &configuration::Configuration, workspace: &str, import_pg_database_request: models::ImportPgDatabaseRequest) -> Result<String, Error<ImportPgDatabaseError>> {
2921    let local_var_configuration = configuration;
2922
2923    let local_var_client = &local_var_configuration.client;
2924
2925    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/import_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2926    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2927
2928    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2929        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2930    }
2931    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2932        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2933    };
2934    local_var_req_builder = local_var_req_builder.json(&import_pg_database_request);
2935
2936    let local_var_req = local_var_req_builder.build()?;
2937    let local_var_resp = local_var_client.execute(local_var_req).await?;
2938
2939    let local_var_status = local_var_resp.status();
2940    let local_var_content = local_var_resp.text().await?;
2941
2942    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2943        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2944    } else {
2945        let local_var_entity: Option<ImportPgDatabaseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2946        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2947        Err(Error::ResponseError(local_var_error))
2948    }
2949}
2950
2951pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
2952    let local_var_configuration = configuration;
2953
2954    let local_var_client = &local_var_configuration.client;
2955
2956    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2957    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2958
2959    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2960        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2961    }
2962    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2963        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2964    };
2965    local_var_req_builder = local_var_req_builder.json(&invite_user_request);
2966
2967    let local_var_req = local_var_req_builder.build()?;
2968    let local_var_resp = local_var_client.execute(local_var_req).await?;
2969
2970    let local_var_status = local_var_resp.status();
2971    let local_var_content = local_var_resp.text().await?;
2972
2973    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2974        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2975    } else {
2976        let local_var_entity: Option<InviteUserError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2977        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2978        Err(Error::ResponseError(local_var_error))
2979    }
2980}
2981
2982pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
2983    let local_var_configuration = configuration;
2984
2985    let local_var_client = &local_var_configuration.client;
2986
2987    let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
2988    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2989
2990    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2991        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2992    }
2993    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2994        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2995    };
2996
2997    let local_var_req = local_var_req_builder.build()?;
2998    let local_var_resp = local_var_client.execute(local_var_req).await?;
2999
3000    let local_var_status = local_var_resp.status();
3001    let local_var_content = local_var_resp.text().await?;
3002
3003    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3004        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3005    } else {
3006        let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3007        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3008        Err(Error::ResponseError(local_var_error))
3009    }
3010}
3011
3012pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
3013    let local_var_configuration = configuration;
3014
3015    let local_var_client = &local_var_configuration.client;
3016
3017    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3018    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3019
3020    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3021        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3022    }
3023    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3024        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3025    };
3026
3027    let local_var_req = local_var_req_builder.build()?;
3028    let local_var_resp = local_var_client.execute(local_var_req).await?;
3029
3030    let local_var_status = local_var_resp.status();
3031    let local_var_content = local_var_resp.text().await?;
3032
3033    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3034        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3035    } else {
3036        let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3037        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3038        Err(Error::ResponseError(local_var_error))
3039    }
3040}
3041
3042pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
3043    let local_var_configuration = configuration;
3044
3045    let local_var_client = &local_var_configuration.client;
3046
3047    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3048    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3049
3050    local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
3051    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3052        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3053    }
3054    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3055        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3056    };
3057
3058    let local_var_req = local_var_req_builder.build()?;
3059    let local_var_resp = local_var_client.execute(local_var_req).await?;
3060
3061    let local_var_status = local_var_resp.status();
3062    let local_var_content = local_var_resp.text().await?;
3063
3064    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3065        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3066    } else {
3067        let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3068        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3069        Err(Error::ResponseError(local_var_error))
3070    }
3071}
3072
3073pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
3074    let local_var_configuration = configuration;
3075
3076    let local_var_client = &local_var_configuration.client;
3077
3078    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3079    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3080
3081    if let Some(ref local_var_str) = search {
3082        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
3083    }
3084    if let Some(ref local_var_str) = next_link {
3085        local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
3086    }
3087    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3088        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3089    }
3090    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3091        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3092    };
3093
3094    let local_var_req = local_var_req_builder.build()?;
3095    let local_var_resp = local_var_client.execute(local_var_req).await?;
3096
3097    let local_var_status = local_var_resp.status();
3098    let local_var_content = local_var_resp.text().await?;
3099
3100    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3101        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3102    } else {
3103        let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3104        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3105        Err(Error::ResponseError(local_var_error))
3106    }
3107}
3108
3109pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
3110    let local_var_configuration = configuration;
3111
3112    let local_var_client = &local_var_configuration.client;
3113
3114    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3115    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3116
3117    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3118        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3119    }
3120    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3121        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3122    };
3123
3124    let local_var_req = local_var_req_builder.build()?;
3125    let local_var_resp = local_var_client.execute(local_var_req).await?;
3126
3127    let local_var_status = local_var_resp.status();
3128    let local_var_content = local_var_resp.text().await?;
3129
3130    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3131        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3132    } else {
3133        let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3134        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3135        Err(Error::ResponseError(local_var_error))
3136    }
3137}
3138
3139pub async fn list_data_table_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableTables>, Error<ListDataTableTablesError>> {
3140    let local_var_configuration = configuration;
3141
3142    let local_var_client = &local_var_configuration.client;
3143
3144    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_tables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3145    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3146
3147    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3148        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3149    }
3150    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3151        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3152    };
3153
3154    let local_var_req = local_var_req_builder.build()?;
3155    let local_var_resp = local_var_client.execute(local_var_req).await?;
3156
3157    let local_var_status = local_var_resp.status();
3158    let local_var_content = local_var_resp.text().await?;
3159
3160    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3161        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3162    } else {
3163        let local_var_entity: Option<ListDataTableTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3164        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3165        Err(Error::ResponseError(local_var_error))
3166    }
3167}
3168
3169pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListDataTables200ResponseInner>, Error<ListDataTablesError>> {
3170    let local_var_configuration = configuration;
3171
3172    let local_var_client = &local_var_configuration.client;
3173
3174    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3175    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3176
3177    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3178        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3179    }
3180    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3181        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3182    };
3183
3184    let local_var_req = local_var_req_builder.build()?;
3185    let local_var_resp = local_var_client.execute(local_var_req).await?;
3186
3187    let local_var_status = local_var_resp.status();
3188    let local_var_content = local_var_resp.text().await?;
3189
3190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3191        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3192    } else {
3193        let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3194        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3195        Err(Error::ResponseError(local_var_error))
3196    }
3197}
3198
3199/// Returns admins and members of wm_deployers in the parent workspace of the fork at `{workspace}`.
3200pub async fn list_deployment_request_eligible_deployers(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DeploymentRequestEligibleDeployer>, Error<ListDeploymentRequestEligibleDeployersError>> {
3201    let local_var_configuration = configuration;
3202
3203    let local_var_client = &local_var_configuration.client;
3204
3205    let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/eligible_deployers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3206    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3207
3208    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3209        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3210    }
3211    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3212        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3213    };
3214
3215    let local_var_req = local_var_req_builder.build()?;
3216    let local_var_resp = local_var_client.execute(local_var_req).await?;
3217
3218    let local_var_status = local_var_resp.status();
3219    let local_var_content = local_var_resp.text().await?;
3220
3221    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3222        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3223    } else {
3224        let local_var_entity: Option<ListDeploymentRequestEligibleDeployersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3225        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3226        Err(Error::ResponseError(local_var_error))
3227    }
3228}
3229
3230pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
3231    let local_var_configuration = configuration;
3232
3233    let local_var_client = &local_var_configuration.client;
3234
3235    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3236    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3237
3238    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3239        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3240    }
3241    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3242        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3243    };
3244
3245    let local_var_req = local_var_req_builder.build()?;
3246    let local_var_resp = local_var_client.execute(local_var_req).await?;
3247
3248    let local_var_status = local_var_resp.status();
3249    let local_var_content = local_var_resp.text().await?;
3250
3251    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3252        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3253    } else {
3254        let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3255        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3256        Err(Error::ResponseError(local_var_error))
3257    }
3258}
3259
3260pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
3261    let local_var_configuration = configuration;
3262
3263    let local_var_client = &local_var_configuration.client;
3264
3265    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3266    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3267
3268    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3269        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3270    }
3271    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3272        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3273    };
3274
3275    let local_var_req = local_var_req_builder.build()?;
3276    let local_var_resp = local_var_client.execute(local_var_req).await?;
3277
3278    let local_var_status = local_var_resp.status();
3279    let local_var_content = local_var_resp.text().await?;
3280
3281    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3282        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3283    } else {
3284        let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3285        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3286        Err(Error::ResponseError(local_var_error))
3287    }
3288}
3289
3290pub async fn list_protection_rules(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ProtectionRuleset>, Error<ListProtectionRulesError>> {
3291    let local_var_configuration = configuration;
3292
3293    let local_var_client = &local_var_configuration.client;
3294
3295    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3296    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3297
3298    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3299        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3300    }
3301    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3302        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3303    };
3304
3305    let local_var_req = local_var_req_builder.build()?;
3306    let local_var_resp = local_var_client.execute(local_var_req).await?;
3307
3308    let local_var_status = local_var_resp.status();
3309    let local_var_content = local_var_resp.text().await?;
3310
3311    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3312        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3313    } else {
3314        let local_var_entity: Option<ListProtectionRulesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3315        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3316        Err(Error::ResponseError(local_var_error))
3317    }
3318}
3319
3320pub async fn list_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::ListSharedUi200Response, Error<ListSharedUiError>> {
3321    let local_var_configuration = configuration;
3322
3323    let local_var_client = &local_var_configuration.client;
3324
3325    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3326    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3327
3328    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3329        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3330    }
3331    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3332        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3333    };
3334
3335    let local_var_req = local_var_req_builder.build()?;
3336    let local_var_resp = local_var_client.execute(local_var_req).await?;
3337
3338    let local_var_status = local_var_resp.status();
3339    let local_var_content = local_var_resp.text().await?;
3340
3341    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3342        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3343    } else {
3344        let local_var_entity: Option<ListSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3345        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3346        Err(Error::ResponseError(local_var_error))
3347    }
3348}
3349
3350pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
3351    let local_var_configuration = configuration;
3352
3353    let local_var_client = &local_var_configuration.client;
3354
3355    let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
3356    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3357
3358    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3359        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3360    }
3361    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3362        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3363    };
3364
3365    let local_var_req = local_var_req_builder.build()?;
3366    let local_var_resp = local_var_client.execute(local_var_req).await?;
3367
3368    let local_var_status = local_var_resp.status();
3369    let local_var_content = local_var_resp.text().await?;
3370
3371    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3372        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3373    } else {
3374        let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3375        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3376        Err(Error::ResponseError(local_var_error))
3377    }
3378}
3379
3380pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
3381    let local_var_configuration = configuration;
3382
3383    let local_var_client = &local_var_configuration.client;
3384
3385    let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
3386    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3387
3388    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3389        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3390    }
3391    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3392        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3393    };
3394
3395    let local_var_req = local_var_req_builder.build()?;
3396    let local_var_resp = local_var_client.execute(local_var_req).await?;
3397
3398    let local_var_status = local_var_resp.status();
3399    let local_var_content = local_var_resp.text().await?;
3400
3401    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3402        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3403    } else {
3404        let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3405        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3406        Err(Error::ResponseError(local_var_error))
3407    }
3408}
3409
3410pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
3411    let local_var_configuration = configuration;
3412
3413    let local_var_client = &local_var_configuration.client;
3414
3415    let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
3416    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3417
3418    if let Some(ref local_var_str) = page {
3419        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3420    }
3421    if let Some(ref local_var_str) = per_page {
3422        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3423    }
3424    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3425        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3426    }
3427    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3428        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3429    };
3430
3431    let local_var_req = local_var_req_builder.build()?;
3432    let local_var_resp = local_var_client.execute(local_var_req).await?;
3433
3434    let local_var_status = local_var_resp.status();
3435    let local_var_content = local_var_resp.text().await?;
3436
3437    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3438        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3439    } else {
3440        let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3441        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3442        Err(Error::ResponseError(local_var_error))
3443    }
3444}
3445
3446pub async fn log_ai_chat(configuration: &configuration::Configuration, workspace: &str, log_ai_chat_request: models::LogAiChatRequest) -> Result<(), Error<LogAiChatError>> {
3447    let local_var_configuration = configuration;
3448
3449    let local_var_client = &local_var_configuration.client;
3450
3451    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/log_chat", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3452    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3453
3454    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3455        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3456    }
3457    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3458        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3459    };
3460    local_var_req_builder = local_var_req_builder.json(&log_ai_chat_request);
3461
3462    let local_var_req = local_var_req_builder.build()?;
3463    let local_var_resp = local_var_client.execute(local_var_req).await?;
3464
3465    let local_var_status = local_var_resp.status();
3466    let local_var_content = local_var_resp.text().await?;
3467
3468    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3469        Ok(())
3470    } else {
3471        let local_var_entity: Option<LogAiChatError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3472        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3473        Err(Error::ResponseError(local_var_error))
3474    }
3475}
3476
3477pub async fn prune_versions(configuration: &configuration::Configuration, workspace: &str, prune_versions_request: models::PruneVersionsRequest) -> Result<models::PruneVersions200Response, Error<PruneVersionsError>> {
3478    let local_var_configuration = configuration;
3479
3480    let local_var_client = &local_var_configuration.client;
3481
3482    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/prune_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3483    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3484
3485    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3486        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3487    }
3488    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3489        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3490    };
3491    local_var_req_builder = local_var_req_builder.json(&prune_versions_request);
3492
3493    let local_var_req = local_var_req_builder.build()?;
3494    let local_var_resp = local_var_client.execute(local_var_req).await?;
3495
3496    let local_var_status = local_var_resp.status();
3497    let local_var_content = local_var_resp.text().await?;
3498
3499    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3500        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3501    } else {
3502        let local_var_entity: Option<PruneVersionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3503        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3504        Err(Error::ResponseError(local_var_error))
3505    }
3506}
3507
3508pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
3509    let local_var_configuration = configuration;
3510
3511    let local_var_client = &local_var_configuration.client;
3512
3513    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3514    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3515
3516    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3517        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3518    }
3519    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3520        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3521    };
3522
3523    let local_var_req = local_var_req_builder.build()?;
3524    let local_var_resp = local_var_client.execute(local_var_req).await?;
3525
3526    let local_var_status = local_var_resp.status();
3527    let local_var_content = local_var_resp.text().await?;
3528
3529    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3530        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3531    } else {
3532        let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3533        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3534        Err(Error::ResponseError(local_var_error))
3535    }
3536}
3537
3538/// This endpoint should be called after a fork deployement
3539pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
3540    let local_var_configuration = configuration;
3541
3542    let local_var_client = &local_var_configuration.client;
3543
3544    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));
3545    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3546
3547    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3548        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3549    }
3550    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3551        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3552    };
3553
3554    let local_var_req = local_var_req_builder.build()?;
3555    let local_var_resp = local_var_client.execute(local_var_req).await?;
3556
3557    let local_var_status = local_var_resp.status();
3558    let local_var_content = local_var_resp.text().await?;
3559
3560    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3561        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3562    } else {
3563        let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3564        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3565        Err(Error::ResponseError(local_var_error))
3566    }
3567}
3568
3569pub 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>> {
3570    let local_var_configuration = configuration;
3571
3572    let local_var_client = &local_var_configuration.client;
3573
3574    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3575    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3576
3577    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3578        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3579    }
3580    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3581        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3582    };
3583    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
3584
3585    let local_var_req = local_var_req_builder.build()?;
3586    let local_var_resp = local_var_client.execute(local_var_req).await?;
3587
3588    let local_var_status = local_var_resp.status();
3589    let local_var_content = local_var_resp.text().await?;
3590
3591    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3592        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3593    } else {
3594        let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3595        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3596        Err(Error::ResponseError(local_var_error))
3597    }
3598}
3599
3600pub 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>> {
3601    let local_var_configuration = configuration;
3602
3603    let local_var_client = &local_var_configuration.client;
3604
3605    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3606    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3607
3608    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3609        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3610    }
3611    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3612        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3613    };
3614    local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
3615
3616    let local_var_req = local_var_req_builder.build()?;
3617    let local_var_resp = local_var_client.execute(local_var_req).await?;
3618
3619    let local_var_status = local_var_resp.status();
3620    let local_var_content = local_var_resp.text().await?;
3621
3622    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3623        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3624    } else {
3625        let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3626        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3627        Err(Error::ResponseError(local_var_error))
3628    }
3629}
3630
3631pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
3632    let local_var_configuration = configuration;
3633
3634    let local_var_client = &local_var_configuration.client;
3635
3636    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3637    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3638
3639    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3640        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3641    }
3642    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3643        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3644    };
3645    local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
3646
3647    let local_var_req = local_var_req_builder.build()?;
3648    let local_var_resp = local_var_client.execute(local_var_req).await?;
3649
3650    let local_var_status = local_var_resp.status();
3651    let local_var_content = local_var_resp.text().await?;
3652
3653    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3654        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3655    } else {
3656        let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3657        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3658        Err(Error::ResponseError(local_var_error))
3659    }
3660}
3661
3662pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
3663    let local_var_configuration = configuration;
3664
3665    let local_var_client = &local_var_configuration.client;
3666
3667    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3668    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3669
3670    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3671        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3672    }
3673    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3674        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3675    };
3676    local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
3677
3678    let local_var_req = local_var_req_builder.build()?;
3679    let local_var_resp = local_var_client.execute(local_var_req).await?;
3680
3681    let local_var_status = local_var_resp.status();
3682    let local_var_content = local_var_resp.text().await?;
3683
3684    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3685        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3686    } else {
3687        let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3688        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3689        Err(Error::ResponseError(local_var_error))
3690    }
3691}
3692
3693pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
3694    let local_var_configuration = configuration;
3695
3696    let local_var_client = &local_var_configuration.client;
3697
3698    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3699    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3700
3701    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3702        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3703    }
3704    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3705        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3706    };
3707    local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
3708
3709    let local_var_req = local_var_req_builder.build()?;
3710    let local_var_resp = local_var_client.execute(local_var_req).await?;
3711
3712    let local_var_status = local_var_resp.status();
3713    let local_var_content = local_var_resp.text().await?;
3714
3715    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3716        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3717    } else {
3718        let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3719        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3720        Err(Error::ResponseError(local_var_error))
3721    }
3722}
3723
3724pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
3725    let local_var_configuration = configuration;
3726
3727    let local_var_client = &local_var_configuration.client;
3728
3729    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3730    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3731
3732    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3733        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3734    }
3735    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3736        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3737    };
3738    local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
3739
3740    let local_var_req = local_var_req_builder.build()?;
3741    let local_var_resp = local_var_client.execute(local_var_req).await?;
3742
3743    let local_var_status = local_var_resp.status();
3744    let local_var_content = local_var_resp.text().await?;
3745
3746    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3747        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3748    } else {
3749        let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3750        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3751        Err(Error::ResponseError(local_var_error))
3752    }
3753}
3754
3755pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
3756    let local_var_configuration = configuration;
3757
3758    let local_var_client = &local_var_configuration.client;
3759
3760    let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3761    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3762
3763    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3764        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3765    }
3766    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3767        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3768    };
3769
3770    let local_var_req = local_var_req_builder.build()?;
3771    let local_var_resp = local_var_client.execute(local_var_req).await?;
3772
3773    let local_var_status = local_var_resp.status();
3774    let local_var_content = local_var_resp.text().await?;
3775
3776    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3777        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3778    } else {
3779        let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3780        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3781        Err(Error::ResponseError(local_var_error))
3782    }
3783}
3784
3785/// Updates the operator settings for a specific workspace. Requires workspace admin privileges.
3786pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
3787    let local_var_configuration = configuration;
3788
3789    let local_var_client = &local_var_configuration.client;
3790
3791    let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3792    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3793
3794    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3795        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3796    }
3797    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3798        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3799    };
3800    local_var_req_builder = local_var_req_builder.json(&operator_settings);
3801
3802    let local_var_req = local_var_req_builder.build()?;
3803    let local_var_resp = local_var_client.execute(local_var_req).await?;
3804
3805    let local_var_status = local_var_resp.status();
3806    let local_var_content = local_var_resp.text().await?;
3807
3808    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3809        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3810    } else {
3811        let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3812        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3813        Err(Error::ResponseError(local_var_error))
3814    }
3815}
3816
3817pub async fn update_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str, update_protection_rule_request: models::UpdateProtectionRuleRequest) -> Result<String, Error<UpdateProtectionRuleError>> {
3818    let local_var_configuration = configuration;
3819
3820    let local_var_client = &local_var_configuration.client;
3821
3822    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));
3823    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3824
3825    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3826        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3827    }
3828    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3829        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3830    };
3831    local_var_req_builder = local_var_req_builder.json(&update_protection_rule_request);
3832
3833    let local_var_req = local_var_req_builder.build()?;
3834    let local_var_resp = local_var_client.execute(local_var_req).await?;
3835
3836    let local_var_status = local_var_resp.status();
3837    let local_var_content = local_var_resp.text().await?;
3838
3839    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3840        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3841    } else {
3842        let local_var_entity: Option<UpdateProtectionRuleError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3843        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3844        Err(Error::ResponseError(local_var_error))
3845    }
3846}
3847
3848pub async fn update_shared_ui(configuration: &configuration::Configuration, workspace: &str, update_shared_ui_request: models::UpdateSharedUiRequest) -> Result<String, Error<UpdateSharedUiError>> {
3849    let local_var_configuration = configuration;
3850
3851    let local_var_client = &local_var_configuration.client;
3852
3853    let local_var_uri_str = format!("{}/w/{workspace}/shared_ui", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3854    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
3855
3856    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3857        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3858    }
3859    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3860        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3861    };
3862    local_var_req_builder = local_var_req_builder.json(&update_shared_ui_request);
3863
3864    let local_var_req = local_var_req_builder.build()?;
3865    let local_var_resp = local_var_client.execute(local_var_req).await?;
3866
3867    let local_var_status = local_var_resp.status();
3868    let local_var_content = local_var_resp.text().await?;
3869
3870    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3871        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3872    } else {
3873        let local_var_entity: Option<UpdateSharedUiError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3874        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3875        Err(Error::ResponseError(local_var_error))
3876    }
3877}
3878