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