Skip to main content

windmill_api/apis/
workspace_api.rs

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