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