Skip to main content

orvanta_api/apis/
workspace_api.rs

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