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