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