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