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