1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AddUserError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ArchiveWorkspaceError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CancelDeploymentRequestError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum ChangeWorkspaceColorError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ChangeWorkspaceIdError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ChangeWorkspaceNameError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CloseDeploymentRequestMergedError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CompareWorkspacesError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum ConnectSlackError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum ConnectTeamsError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum CreateDeploymentRequestError {
92 Status400(),
93 Status409(),
94 UnknownValue(serde_json::Value),
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum CreateDeploymentRequestCommentError {
101 Status400(),
102 UnknownValue(serde_json::Value),
103}
104
105#[derive(Debug, Clone, Serialize, Deserialize)]
107#[serde(untagged)]
108pub enum CreatePgDatabaseError {
109 UnknownValue(serde_json::Value),
110}
111
112#[derive(Debug, Clone, Serialize, Deserialize)]
114#[serde(untagged)]
115pub enum CreateProtectionRuleError {
116 Status400(),
117 UnknownValue(serde_json::Value),
118}
119
120#[derive(Debug, Clone, Serialize, Deserialize)]
122#[serde(untagged)]
123pub enum CreateServiceAccountError {
124 UnknownValue(serde_json::Value),
125}
126
127#[derive(Debug, Clone, Serialize, Deserialize)]
129#[serde(untagged)]
130pub enum CreateWorkspaceError {
131 UnknownValue(serde_json::Value),
132}
133
134#[derive(Debug, Clone, Serialize, Deserialize)]
136#[serde(untagged)]
137pub enum CreateWorkspaceForkError {
138 UnknownValue(serde_json::Value),
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(untagged)]
144pub enum CreateWorkspaceForkGitBranchError {
145 UnknownValue(serde_json::Value),
146}
147
148#[derive(Debug, Clone, Serialize, Deserialize)]
150#[serde(untagged)]
151pub enum DeleteGitSyncRepositoryError {
152 UnknownValue(serde_json::Value),
153}
154
155#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(untagged)]
158pub enum DeleteInviteError {
159 UnknownValue(serde_json::Value),
160}
161
162#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum DeleteProtectionRuleError {
166 Status404(),
167 UnknownValue(serde_json::Value),
168}
169
170#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum DeleteWorkspaceError {
174 UnknownValue(serde_json::Value),
175}
176
177#[derive(Debug, Clone, Serialize, Deserialize)]
179#[serde(untagged)]
180pub enum DeleteWorkspaceSlackOauthConfigError {
181 UnknownValue(serde_json::Value),
182}
183
184#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(untagged)]
187pub enum DropForkedDatatableDatabasesError {
188 UnknownValue(serde_json::Value),
189}
190
191#[derive(Debug, Clone, Serialize, Deserialize)]
193#[serde(untagged)]
194pub enum EditAutoInviteError {
195 UnknownValue(serde_json::Value),
196}
197
198#[derive(Debug, Clone, Serialize, Deserialize)]
200#[serde(untagged)]
201pub enum EditCopilotConfigError {
202 UnknownValue(serde_json::Value),
203}
204
205#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum EditDataTableConfigError {
209 UnknownValue(serde_json::Value),
210}
211
212#[derive(Debug, Clone, Serialize, Deserialize)]
214#[serde(untagged)]
215pub enum EditDefaultScriptsError {
216 UnknownValue(serde_json::Value),
217}
218
219#[derive(Debug, Clone, Serialize, Deserialize)]
221#[serde(untagged)]
222pub enum EditDeployToError {
223 UnknownValue(serde_json::Value),
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum EditDucklakeConfigError {
230 UnknownValue(serde_json::Value),
231}
232
233#[derive(Debug, Clone, Serialize, Deserialize)]
235#[serde(untagged)]
236pub enum EditErrorHandlerError {
237 UnknownValue(serde_json::Value),
238}
239
240#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum EditGitSyncRepositoryError {
244 UnknownValue(serde_json::Value),
245}
246
247#[derive(Debug, Clone, Serialize, Deserialize)]
249#[serde(untagged)]
250pub enum EditInstanceGroupsError {
251 UnknownValue(serde_json::Value),
252}
253
254#[derive(Debug, Clone, Serialize, Deserialize)]
256#[serde(untagged)]
257pub enum EditLargeFileStorageConfigError {
258 UnknownValue(serde_json::Value),
259}
260
261#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum EditSlackCommandError {
265 UnknownValue(serde_json::Value),
266}
267
268#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum EditSuccessHandlerError {
272 UnknownValue(serde_json::Value),
273}
274
275#[derive(Debug, Clone, Serialize, Deserialize)]
277#[serde(untagged)]
278pub enum EditTeamsCommandError {
279 UnknownValue(serde_json::Value),
280}
281
282#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum EditWebhookError {
286 UnknownValue(serde_json::Value),
287}
288
289#[derive(Debug, Clone, Serialize, Deserialize)]
291#[serde(untagged)]
292pub enum EditWorkspaceDefaultAppError {
293 UnknownValue(serde_json::Value),
294}
295
296#[derive(Debug, Clone, Serialize, Deserialize)]
298#[serde(untagged)]
299pub enum EditWorkspaceDeployUiSettingsError {
300 UnknownValue(serde_json::Value),
301}
302
303#[derive(Debug, Clone, Serialize, Deserialize)]
305#[serde(untagged)]
306pub enum EditWorkspaceGitSyncConfigError {
307 UnknownValue(serde_json::Value),
308}
309
310#[derive(Debug, Clone, Serialize, Deserialize)]
312#[serde(untagged)]
313pub enum ExistsUsernameError {
314 UnknownValue(serde_json::Value),
315}
316
317#[derive(Debug, Clone, Serialize, Deserialize)]
319#[serde(untagged)]
320pub enum ExistsWorkspaceError {
321 UnknownValue(serde_json::Value),
322}
323
324#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum ExportPgSchemaError {
328 UnknownValue(serde_json::Value),
329}
330
331#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum GetCloudQuotasError {
335 UnknownValue(serde_json::Value),
336}
337
338#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum GetCopilotInfoError {
342 UnknownValue(serde_json::Value),
343}
344
345#[derive(Debug, Clone, Serialize, Deserialize)]
347#[serde(untagged)]
348pub enum GetCopilotSettingsStateError {
349 UnknownValue(serde_json::Value),
350}
351
352#[derive(Debug, Clone, Serialize, Deserialize)]
354#[serde(untagged)]
355pub enum GetDataTableTableSchemaError {
356 UnknownValue(serde_json::Value),
357}
358
359#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum GetDatatableFullSchemaError {
363 UnknownValue(serde_json::Value),
364}
365
366#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum GetDefaultScriptsError {
370 UnknownValue(serde_json::Value),
371}
372
373#[derive(Debug, Clone, Serialize, Deserialize)]
375#[serde(untagged)]
376pub enum GetDependencyMapError {
377 UnknownValue(serde_json::Value),
378}
379
380#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(untagged)]
383pub enum GetDependentsError {
384 UnknownValue(serde_json::Value),
385}
386
387#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum GetDependentsAmountsError {
391 UnknownValue(serde_json::Value),
392}
393
394#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum GetDeployToError {
398 UnknownValue(serde_json::Value),
399}
400
401#[derive(Debug, Clone, Serialize, Deserialize)]
403#[serde(untagged)]
404pub enum GetGitSyncEnabledError {
405 UnknownValue(serde_json::Value),
406}
407
408#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum GetGithubAppTokenError {
412 UnknownValue(serde_json::Value),
413}
414
415#[derive(Debug, Clone, Serialize, Deserialize)]
417#[serde(untagged)]
418pub enum GetImportsError {
419 UnknownValue(serde_json::Value),
420}
421
422#[derive(Debug, Clone, Serialize, Deserialize)]
424#[serde(untagged)]
425pub enum GetIsPremiumError {
426 UnknownValue(serde_json::Value),
427}
428
429#[derive(Debug, Clone, Serialize, Deserialize)]
431#[serde(untagged)]
432pub enum GetOpenDeploymentRequestError {
433 UnknownValue(serde_json::Value),
434}
435
436#[derive(Debug, Clone, Serialize, Deserialize)]
438#[serde(untagged)]
439pub enum GetPublicSettingsError {
440 UnknownValue(serde_json::Value),
441}
442
443#[derive(Debug, Clone, Serialize, Deserialize)]
445#[serde(untagged)]
446pub enum GetSettingsError {
447 UnknownValue(serde_json::Value),
448}
449
450#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetSharedUiError {
454 UnknownValue(serde_json::Value),
455}
456
457#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum GetSharedUiVersionError {
461 UnknownValue(serde_json::Value),
462}
463
464#[derive(Debug, Clone, Serialize, Deserialize)]
466#[serde(untagged)]
467pub enum GetThresholdAlertError {
468 UnknownValue(serde_json::Value),
469}
470
471#[derive(Debug, Clone, Serialize, Deserialize)]
473#[serde(untagged)]
474pub enum GetUsedTriggersError {
475 UnknownValue(serde_json::Value),
476}
477
478#[derive(Debug, Clone, Serialize, Deserialize)]
480#[serde(untagged)]
481pub enum GetWorkspaceAsSuperAdminError {
482 UnknownValue(serde_json::Value),
483}
484
485#[derive(Debug, Clone, Serialize, Deserialize)]
487#[serde(untagged)]
488pub enum GetWorkspaceDefaultAppError {
489 UnknownValue(serde_json::Value),
490}
491
492#[derive(Debug, Clone, Serialize, Deserialize)]
494#[serde(untagged)]
495pub enum GetWorkspaceEncryptionKeyError {
496 UnknownValue(serde_json::Value),
497}
498
499#[derive(Debug, Clone, Serialize, Deserialize)]
501#[serde(untagged)]
502pub enum GetWorkspaceNameError {
503 UnknownValue(serde_json::Value),
504}
505
506#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum GetWorkspaceSlackOauthConfigError {
510 UnknownValue(serde_json::Value),
511}
512
513#[derive(Debug, Clone, Serialize, Deserialize)]
515#[serde(untagged)]
516pub enum GetWorkspaceUsageError {
517 UnknownValue(serde_json::Value),
518}
519
520#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum ImportPgDatabaseError {
524 UnknownValue(serde_json::Value),
525}
526
527#[derive(Debug, Clone, Serialize, Deserialize)]
529#[serde(untagged)]
530pub enum InviteUserError {
531 UnknownValue(serde_json::Value),
532}
533
534#[derive(Debug, Clone, Serialize, Deserialize)]
536#[serde(untagged)]
537pub enum IsDomainAllowedError {
538 UnknownValue(serde_json::Value),
539}
540
541#[derive(Debug, Clone, Serialize, Deserialize)]
543#[serde(untagged)]
544pub enum LeaveWorkspaceError {
545 UnknownValue(serde_json::Value),
546}
547
548#[derive(Debug, Clone, Serialize, Deserialize)]
550#[serde(untagged)]
551pub enum ListAvailableTeamsChannelsError {
552 UnknownValue(serde_json::Value),
553}
554
555#[derive(Debug, Clone, Serialize, Deserialize)]
557#[serde(untagged)]
558pub enum ListAvailableTeamsIdsError {
559 UnknownValue(serde_json::Value),
560}
561
562#[derive(Debug, Clone, Serialize, Deserialize)]
564#[serde(untagged)]
565pub enum ListDataTableSchemasError {
566 UnknownValue(serde_json::Value),
567}
568
569#[derive(Debug, Clone, Serialize, Deserialize)]
571#[serde(untagged)]
572pub enum ListDataTableTablesError {
573 UnknownValue(serde_json::Value),
574}
575
576#[derive(Debug, Clone, Serialize, Deserialize)]
578#[serde(untagged)]
579pub enum ListDataTablesError {
580 UnknownValue(serde_json::Value),
581}
582
583#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum ListDeploymentRequestEligibleDeployersError {
587 UnknownValue(serde_json::Value),
588}
589
590#[derive(Debug, Clone, Serialize, Deserialize)]
592#[serde(untagged)]
593pub enum ListDucklakesError {
594 UnknownValue(serde_json::Value),
595}
596
597#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum ListPendingInvitesError {
601 UnknownValue(serde_json::Value),
602}
603
604#[derive(Debug, Clone, Serialize, Deserialize)]
606#[serde(untagged)]
607pub enum ListProtectionRulesError {
608 UnknownValue(serde_json::Value),
609}
610
611#[derive(Debug, Clone, Serialize, Deserialize)]
613#[serde(untagged)]
614pub enum ListSharedUiError {
615 UnknownValue(serde_json::Value),
616}
617
618#[derive(Debug, Clone, Serialize, Deserialize)]
620#[serde(untagged)]
621pub enum ListUserWorkspacesError {
622 UnknownValue(serde_json::Value),
623}
624
625#[derive(Debug, Clone, Serialize, Deserialize)]
627#[serde(untagged)]
628pub enum ListWorkspacesError {
629 UnknownValue(serde_json::Value),
630}
631
632#[derive(Debug, Clone, Serialize, Deserialize)]
634#[serde(untagged)]
635pub enum ListWorkspacesAsSuperAdminError {
636 UnknownValue(serde_json::Value),
637}
638
639#[derive(Debug, Clone, Serialize, Deserialize)]
641#[serde(untagged)]
642pub enum ListWsSpecificError {
643 UnknownValue(serde_json::Value),
644}
645
646#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum ListWsSpecificVersionsError {
650 UnknownValue(serde_json::Value),
651}
652
653#[derive(Debug, Clone, Serialize, Deserialize)]
655#[serde(untagged)]
656pub enum LogAiChatError {
657 UnknownValue(serde_json::Value),
658}
659
660#[derive(Debug, Clone, Serialize, Deserialize)]
662#[serde(untagged)]
663pub enum PruneVersionsError {
664 UnknownValue(serde_json::Value),
665}
666
667#[derive(Debug, Clone, Serialize, Deserialize)]
669#[serde(untagged)]
670pub enum RebuildDependencyMapError {
671 UnknownValue(serde_json::Value),
672}
673
674#[derive(Debug, Clone, Serialize, Deserialize)]
676#[serde(untagged)]
677pub enum ResetDiffTallyError {
678 UnknownValue(serde_json::Value),
679}
680
681#[derive(Debug, Clone, Serialize, Deserialize)]
683#[serde(untagged)]
684pub enum RunSlackMessageTestJobError {
685 UnknownValue(serde_json::Value),
686}
687
688#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(untagged)]
691pub enum RunTeamsMessageTestJobError {
692 UnknownValue(serde_json::Value),
693}
694
695#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum SetEnvironmentVariableError {
699 UnknownValue(serde_json::Value),
700}
701
702#[derive(Debug, Clone, Serialize, Deserialize)]
704#[serde(untagged)]
705pub enum SetThresholdAlertError {
706 UnknownValue(serde_json::Value),
707}
708
709#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum SetWorkspaceEncryptionKeyError {
713 UnknownValue(serde_json::Value),
714}
715
716#[derive(Debug, Clone, Serialize, Deserialize)]
718#[serde(untagged)]
719pub enum SetWorkspaceSlackOauthConfigError {
720 UnknownValue(serde_json::Value),
721}
722
723#[derive(Debug, Clone, Serialize, Deserialize)]
725#[serde(untagged)]
726pub enum TarballWorkspaceError {
727 UnknownValue(serde_json::Value),
728}
729
730#[derive(Debug, Clone, Serialize, Deserialize)]
732#[serde(untagged)]
733pub enum UnarchiveWorkspaceError {
734 UnknownValue(serde_json::Value),
735}
736
737#[derive(Debug, Clone, Serialize, Deserialize)]
739#[serde(untagged)]
740pub enum UpdateOperatorSettingsError {
741 UnknownValue(serde_json::Value),
742}
743
744#[derive(Debug, Clone, Serialize, Deserialize)]
746#[serde(untagged)]
747pub enum UpdateProtectionRuleError {
748 Status404(),
749 UnknownValue(serde_json::Value),
750}
751
752#[derive(Debug, Clone, Serialize, Deserialize)]
754#[serde(untagged)]
755pub enum UpdateSharedUiError {
756 UnknownValue(serde_json::Value),
757}
758
759
760pub async fn add_user(configuration: &configuration::Configuration, workspace: &str, add_user_request: models::AddUserRequest) -> Result<String, Error<AddUserError>> {
761 let local_var_configuration = configuration;
762
763 let local_var_client = &local_var_configuration.client;
764
765 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/add_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
766 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
767
768 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
769 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
770 }
771 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
772 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
773 };
774 local_var_req_builder = local_var_req_builder.json(&add_user_request);
775
776 let local_var_req = local_var_req_builder.build()?;
777 let local_var_resp = local_var_client.execute(local_var_req).await?;
778
779 let local_var_status = local_var_resp.status();
780 let local_var_content = local_var_resp.text().await?;
781
782 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
783 crate::from_str_patched(&local_var_content).map_err(Error::from)
784 } else {
785 let local_var_entity: Option<AddUserError> = crate::from_str_patched(&local_var_content).ok();
786 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
787 Err(Error::ResponseError(local_var_error))
788 }
789}
790
791pub async fn archive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<ArchiveWorkspaceError>> {
792 let local_var_configuration = configuration;
793
794 let local_var_client = &local_var_configuration.client;
795
796 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/archive", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
797 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
798
799 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
800 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
801 }
802 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
803 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
804 };
805
806 let local_var_req = local_var_req_builder.build()?;
807 let local_var_resp = local_var_client.execute(local_var_req).await?;
808
809 let local_var_status = local_var_resp.status();
810 let local_var_content = local_var_resp.text().await?;
811
812 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
813 crate::from_str_patched(&local_var_content).map_err(Error::from)
814 } else {
815 let local_var_entity: Option<ArchiveWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
816 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
817 Err(Error::ResponseError(local_var_error))
818 }
819}
820
821pub async fn cancel_deployment_request(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CancelDeploymentRequestError>> {
822 let local_var_configuration = configuration;
823
824 let local_var_client = &local_var_configuration.client;
825
826 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/cancel", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
827 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
828
829 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
830 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
831 }
832 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
833 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
834 };
835
836 let local_var_req = local_var_req_builder.build()?;
837 let local_var_resp = local_var_client.execute(local_var_req).await?;
838
839 let local_var_status = local_var_resp.status();
840 let local_var_content = local_var_resp.text().await?;
841
842 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
843 crate::from_str_patched(&local_var_content).map_err(Error::from)
844 } else {
845 let local_var_entity: Option<CancelDeploymentRequestError> = crate::from_str_patched(&local_var_content).ok();
846 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
847 Err(Error::ResponseError(local_var_error))
848 }
849}
850
851pub async fn change_workspace_color(configuration: &configuration::Configuration, workspace: &str, change_workspace_color_request: Option<models::ChangeWorkspaceColorRequest>) -> Result<String, Error<ChangeWorkspaceColorError>> {
852 let local_var_configuration = configuration;
853
854 let local_var_client = &local_var_configuration.client;
855
856 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_color", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
857 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
858
859 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
860 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
861 }
862 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
863 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
864 };
865 local_var_req_builder = local_var_req_builder.json(&change_workspace_color_request);
866
867 let local_var_req = local_var_req_builder.build()?;
868 let local_var_resp = local_var_client.execute(local_var_req).await?;
869
870 let local_var_status = local_var_resp.status();
871 let local_var_content = local_var_resp.text().await?;
872
873 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
874 crate::from_str_patched(&local_var_content).map_err(Error::from)
875 } else {
876 let local_var_entity: Option<ChangeWorkspaceColorError> = crate::from_str_patched(&local_var_content).ok();
877 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
878 Err(Error::ResponseError(local_var_error))
879 }
880}
881
882pub async fn change_workspace_id(configuration: &configuration::Configuration, workspace: &str, change_workspace_id_request: Option<models::ChangeWorkspaceIdRequest>) -> Result<String, Error<ChangeWorkspaceIdError>> {
883 let local_var_configuration = configuration;
884
885 let local_var_client = &local_var_configuration.client;
886
887 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_id", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
888 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
889
890 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
891 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
892 }
893 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
894 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
895 };
896 local_var_req_builder = local_var_req_builder.json(&change_workspace_id_request);
897
898 let local_var_req = local_var_req_builder.build()?;
899 let local_var_resp = local_var_client.execute(local_var_req).await?;
900
901 let local_var_status = local_var_resp.status();
902 let local_var_content = local_var_resp.text().await?;
903
904 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
905 crate::from_str_patched(&local_var_content).map_err(Error::from)
906 } else {
907 let local_var_entity: Option<ChangeWorkspaceIdError> = crate::from_str_patched(&local_var_content).ok();
908 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
909 Err(Error::ResponseError(local_var_error))
910 }
911}
912
913pub async fn change_workspace_name(configuration: &configuration::Configuration, workspace: &str, change_workspace_name_request: Option<models::ChangeWorkspaceNameRequest>) -> Result<String, Error<ChangeWorkspaceNameError>> {
914 let local_var_configuration = configuration;
915
916 let local_var_client = &local_var_configuration.client;
917
918 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/change_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
919 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
920
921 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
922 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
923 }
924 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
925 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
926 };
927 local_var_req_builder = local_var_req_builder.json(&change_workspace_name_request);
928
929 let local_var_req = local_var_req_builder.build()?;
930 let local_var_resp = local_var_client.execute(local_var_req).await?;
931
932 let local_var_status = local_var_resp.status();
933 let local_var_content = local_var_resp.text().await?;
934
935 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
936 crate::from_str_patched(&local_var_content).map_err(Error::from)
937 } else {
938 let local_var_entity: Option<ChangeWorkspaceNameError> = crate::from_str_patched(&local_var_content).ok();
939 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
940 Err(Error::ResponseError(local_var_error))
941 }
942}
943
944pub async fn close_deployment_request_merged(configuration: &configuration::Configuration, workspace: &str, id: i64) -> Result<String, Error<CloseDeploymentRequestMergedError>> {
946 let local_var_configuration = configuration;
947
948 let local_var_client = &local_var_configuration.client;
949
950 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/close_merged", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
951 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
952
953 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
954 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
955 }
956 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
957 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
958 };
959
960 let local_var_req = local_var_req_builder.build()?;
961 let local_var_resp = local_var_client.execute(local_var_req).await?;
962
963 let local_var_status = local_var_resp.status();
964 let local_var_content = local_var_resp.text().await?;
965
966 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
967 crate::from_str_patched(&local_var_content).map_err(Error::from)
968 } else {
969 let local_var_entity: Option<CloseDeploymentRequestMergedError> = crate::from_str_patched(&local_var_content).ok();
970 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
971 Err(Error::ResponseError(local_var_error))
972 }
973}
974
975pub async fn compare_workspaces(configuration: &configuration::Configuration, workspace: &str, target_workspace_id: &str) -> Result<models::WorkspaceComparison, Error<CompareWorkspacesError>> {
977 let local_var_configuration = configuration;
978
979 let local_var_client = &local_var_configuration.client;
980
981 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));
982 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
983
984 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
985 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
986 }
987 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
988 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
989 };
990
991 let local_var_req = local_var_req_builder.build()?;
992 let local_var_resp = local_var_client.execute(local_var_req).await?;
993
994 let local_var_status = local_var_resp.status();
995 let local_var_content = local_var_resp.text().await?;
996
997 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
998 crate::from_str_patched(&local_var_content).map_err(Error::from)
999 } else {
1000 let local_var_entity: Option<CompareWorkspacesError> = crate::from_str_patched(&local_var_content).ok();
1001 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1002 Err(Error::ResponseError(local_var_error))
1003 }
1004}
1005
1006pub async fn connect_slack(configuration: &configuration::Configuration, workspace: &str, connect_slack_request: models::ConnectSlackRequest) -> Result<(), Error<ConnectSlackError>> {
1007 let local_var_configuration = configuration;
1008
1009 let local_var_client = &local_var_configuration.client;
1010
1011 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_slack", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1012 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1013
1014 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1015 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1016 }
1017 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1018 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1019 };
1020 local_var_req_builder = local_var_req_builder.json(&connect_slack_request);
1021
1022 let local_var_req = local_var_req_builder.build()?;
1023 let local_var_resp = local_var_client.execute(local_var_req).await?;
1024
1025 let local_var_status = local_var_resp.status();
1026 let local_var_content = local_var_resp.text().await?;
1027
1028 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1029 Ok(())
1030 } else {
1031 let local_var_entity: Option<ConnectSlackError> = crate::from_str_patched(&local_var_content).ok();
1032 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1033 Err(Error::ResponseError(local_var_error))
1034 }
1035}
1036
1037pub async fn connect_teams(configuration: &configuration::Configuration, workspace: &str, connect_teams_request: models::ConnectTeamsRequest) -> Result<String, Error<ConnectTeamsError>> {
1038 let local_var_configuration = configuration;
1039
1040 let local_var_client = &local_var_configuration.client;
1041
1042 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/connect_teams", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1043 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1044
1045 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1046 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1047 }
1048 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1049 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1050 };
1051 local_var_req_builder = local_var_req_builder.json(&connect_teams_request);
1052
1053 let local_var_req = local_var_req_builder.build()?;
1054 let local_var_resp = local_var_client.execute(local_var_req).await?;
1055
1056 let local_var_status = local_var_resp.status();
1057 let local_var_content = local_var_resp.text().await?;
1058
1059 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1060 crate::from_str_patched(&local_var_content).map_err(Error::from)
1061 } else {
1062 let local_var_entity: Option<ConnectTeamsError> = crate::from_str_patched(&local_var_content).ok();
1063 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1064 Err(Error::ResponseError(local_var_error))
1065 }
1066}
1067
1068pub async fn create_deployment_request(configuration: &configuration::Configuration, workspace: &str, create_deployment_request_request: models::CreateDeploymentRequestRequest) -> Result<models::DeploymentRequest, Error<CreateDeploymentRequestError>> {
1069 let local_var_configuration = configuration;
1070
1071 let local_var_client = &local_var_configuration.client;
1072
1073 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1074 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1075
1076 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1077 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1078 }
1079 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1080 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1081 };
1082 local_var_req_builder = local_var_req_builder.json(&create_deployment_request_request);
1083
1084 let local_var_req = local_var_req_builder.build()?;
1085 let local_var_resp = local_var_client.execute(local_var_req).await?;
1086
1087 let local_var_status = local_var_resp.status();
1088 let local_var_content = local_var_resp.text().await?;
1089
1090 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1091 crate::from_str_patched(&local_var_content).map_err(Error::from)
1092 } else {
1093 let local_var_entity: Option<CreateDeploymentRequestError> = crate::from_str_patched(&local_var_content).ok();
1094 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1095 Err(Error::ResponseError(local_var_error))
1096 }
1097}
1098
1099pub async fn create_deployment_request_comment(configuration: &configuration::Configuration, workspace: &str, id: i64, create_deployment_request_comment_request: models::CreateDeploymentRequestCommentRequest) -> Result<models::DeploymentRequestComment, Error<CreateDeploymentRequestCommentError>> {
1100 let local_var_configuration = configuration;
1101
1102 let local_var_client = &local_var_configuration.client;
1103
1104 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/{id}/comment", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
1105 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1106
1107 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1108 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1109 }
1110 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1111 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1112 };
1113 local_var_req_builder = local_var_req_builder.json(&create_deployment_request_comment_request);
1114
1115 let local_var_req = local_var_req_builder.build()?;
1116 let local_var_resp = local_var_client.execute(local_var_req).await?;
1117
1118 let local_var_status = local_var_resp.status();
1119 let local_var_content = local_var_resp.text().await?;
1120
1121 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1122 crate::from_str_patched(&local_var_content).map_err(Error::from)
1123 } else {
1124 let local_var_entity: Option<CreateDeploymentRequestCommentError> = crate::from_str_patched(&local_var_content).ok();
1125 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1126 Err(Error::ResponseError(local_var_error))
1127 }
1128}
1129
1130pub async fn create_pg_database(configuration: &configuration::Configuration, workspace: &str, create_pg_database_request: models::CreatePgDatabaseRequest) -> Result<String, Error<CreatePgDatabaseError>> {
1131 let local_var_configuration = configuration;
1132
1133 let local_var_client = &local_var_configuration.client;
1134
1135 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1136 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1137
1138 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1139 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1140 }
1141 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1142 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1143 };
1144 local_var_req_builder = local_var_req_builder.json(&create_pg_database_request);
1145
1146 let local_var_req = local_var_req_builder.build()?;
1147 let local_var_resp = local_var_client.execute(local_var_req).await?;
1148
1149 let local_var_status = local_var_resp.status();
1150 let local_var_content = local_var_resp.text().await?;
1151
1152 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1153 crate::from_str_patched(&local_var_content).map_err(Error::from)
1154 } else {
1155 let local_var_entity: Option<CreatePgDatabaseError> = crate::from_str_patched(&local_var_content).ok();
1156 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1157 Err(Error::ResponseError(local_var_error))
1158 }
1159}
1160
1161pub async fn create_protection_rule(configuration: &configuration::Configuration, workspace: &str, create_protection_rule_request: models::CreateProtectionRuleRequest) -> Result<String, Error<CreateProtectionRuleError>> {
1162 let local_var_configuration = configuration;
1163
1164 let local_var_client = &local_var_configuration.client;
1165
1166 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1167 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1168
1169 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1170 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1171 }
1172 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1173 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1174 };
1175 local_var_req_builder = local_var_req_builder.json(&create_protection_rule_request);
1176
1177 let local_var_req = local_var_req_builder.build()?;
1178 let local_var_resp = local_var_client.execute(local_var_req).await?;
1179
1180 let local_var_status = local_var_resp.status();
1181 let local_var_content = local_var_resp.text().await?;
1182
1183 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1184 crate::from_str_patched(&local_var_content).map_err(Error::from)
1185 } else {
1186 let local_var_entity: Option<CreateProtectionRuleError> = crate::from_str_patched(&local_var_content).ok();
1187 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1188 Err(Error::ResponseError(local_var_error))
1189 }
1190}
1191
1192pub async fn create_service_account(configuration: &configuration::Configuration, workspace: &str, create_service_account_request: models::CreateServiceAccountRequest) -> Result<String, Error<CreateServiceAccountError>> {
1193 let local_var_configuration = configuration;
1194
1195 let local_var_client = &local_var_configuration.client;
1196
1197 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_service_account", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1198 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1199
1200 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1201 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1202 }
1203 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1204 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1205 };
1206 local_var_req_builder = local_var_req_builder.json(&create_service_account_request);
1207
1208 let local_var_req = local_var_req_builder.build()?;
1209 let local_var_resp = local_var_client.execute(local_var_req).await?;
1210
1211 let local_var_status = local_var_resp.status();
1212 let local_var_content = local_var_resp.text().await?;
1213
1214 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1215 crate::from_str_patched(&local_var_content).map_err(Error::from)
1216 } else {
1217 let local_var_entity: Option<CreateServiceAccountError> = crate::from_str_patched(&local_var_content).ok();
1218 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1219 Err(Error::ResponseError(local_var_error))
1220 }
1221}
1222
1223pub async fn create_workspace(configuration: &configuration::Configuration, create_workspace: models::CreateWorkspace) -> Result<String, Error<CreateWorkspaceError>> {
1224 let local_var_configuration = configuration;
1225
1226 let local_var_client = &local_var_configuration.client;
1227
1228 let local_var_uri_str = format!("{}/workspaces/create", local_var_configuration.base_path);
1229 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1230
1231 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1232 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1233 }
1234 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1235 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1236 };
1237 local_var_req_builder = local_var_req_builder.json(&create_workspace);
1238
1239 let local_var_req = local_var_req_builder.build()?;
1240 let local_var_resp = local_var_client.execute(local_var_req).await?;
1241
1242 let local_var_status = local_var_resp.status();
1243 let local_var_content = local_var_resp.text().await?;
1244
1245 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1246 crate::from_str_patched(&local_var_content).map_err(Error::from)
1247 } else {
1248 let local_var_entity: Option<CreateWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
1249 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1250 Err(Error::ResponseError(local_var_error))
1251 }
1252}
1253
1254pub async fn create_workspace_fork(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<String, Error<CreateWorkspaceForkError>> {
1255 let local_var_configuration = configuration;
1256
1257 let local_var_client = &local_var_configuration.client;
1258
1259 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_fork", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1260 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1261
1262 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1263 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1264 }
1265 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1266 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1267 };
1268 local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1269
1270 let local_var_req = local_var_req_builder.build()?;
1271 let local_var_resp = local_var_client.execute(local_var_req).await?;
1272
1273 let local_var_status = local_var_resp.status();
1274 let local_var_content = local_var_resp.text().await?;
1275
1276 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1277 crate::from_str_patched(&local_var_content).map_err(Error::from)
1278 } else {
1279 let local_var_entity: Option<CreateWorkspaceForkError> = crate::from_str_patched(&local_var_content).ok();
1280 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1281 Err(Error::ResponseError(local_var_error))
1282 }
1283}
1284
1285pub async fn create_workspace_fork_git_branch(configuration: &configuration::Configuration, workspace: &str, create_workspace_fork: models::CreateWorkspaceFork) -> Result<Vec<uuid::Uuid>, Error<CreateWorkspaceForkGitBranchError>> {
1286 let local_var_configuration = configuration;
1287
1288 let local_var_client = &local_var_configuration.client;
1289
1290 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/create_workspace_fork_branch", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1291 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1292
1293 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1294 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1295 }
1296 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1297 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1298 };
1299 local_var_req_builder = local_var_req_builder.json(&create_workspace_fork);
1300
1301 let local_var_req = local_var_req_builder.build()?;
1302 let local_var_resp = local_var_client.execute(local_var_req).await?;
1303
1304 let local_var_status = local_var_resp.status();
1305 let local_var_content = local_var_resp.text().await?;
1306
1307 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1308 crate::from_str_patched(&local_var_content).map_err(Error::from)
1309 } else {
1310 let local_var_entity: Option<CreateWorkspaceForkGitBranchError> = crate::from_str_patched(&local_var_content).ok();
1311 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1312 Err(Error::ResponseError(local_var_error))
1313 }
1314}
1315
1316pub async fn delete_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, delete_git_sync_repository_request: models::DeleteGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<DeleteGitSyncRepositoryError>> {
1317 let local_var_configuration = configuration;
1318
1319 let local_var_client = &local_var_configuration.client;
1320
1321 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1322 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1323
1324 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1325 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1326 }
1327 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1328 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1329 };
1330 local_var_req_builder = local_var_req_builder.json(&delete_git_sync_repository_request);
1331
1332 let local_var_req = local_var_req_builder.build()?;
1333 let local_var_resp = local_var_client.execute(local_var_req).await?;
1334
1335 let local_var_status = local_var_resp.status();
1336 let local_var_content = local_var_resp.text().await?;
1337
1338 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1339 crate::from_str_patched(&local_var_content).map_err(Error::from)
1340 } else {
1341 let local_var_entity: Option<DeleteGitSyncRepositoryError> = crate::from_str_patched(&local_var_content).ok();
1342 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1343 Err(Error::ResponseError(local_var_error))
1344 }
1345}
1346
1347pub async fn delete_invite(configuration: &configuration::Configuration, workspace: &str, delete_invite_request: models::DeleteInviteRequest) -> Result<String, Error<DeleteInviteError>> {
1348 let local_var_configuration = configuration;
1349
1350 let local_var_client = &local_var_configuration.client;
1351
1352 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/delete_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1353 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1354
1355 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1356 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1357 }
1358 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1359 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1360 };
1361 local_var_req_builder = local_var_req_builder.json(&delete_invite_request);
1362
1363 let local_var_req = local_var_req_builder.build()?;
1364 let local_var_resp = local_var_client.execute(local_var_req).await?;
1365
1366 let local_var_status = local_var_resp.status();
1367 let local_var_content = local_var_resp.text().await?;
1368
1369 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1370 crate::from_str_patched(&local_var_content).map_err(Error::from)
1371 } else {
1372 let local_var_entity: Option<DeleteInviteError> = crate::from_str_patched(&local_var_content).ok();
1373 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1374 Err(Error::ResponseError(local_var_error))
1375 }
1376}
1377
1378pub async fn delete_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str) -> Result<String, Error<DeleteProtectionRuleError>> {
1379 let local_var_configuration = configuration;
1380
1381 let local_var_client = &local_var_configuration.client;
1382
1383 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));
1384 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1385
1386 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1387 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1388 }
1389 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1390 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1391 };
1392
1393 let local_var_req = local_var_req_builder.build()?;
1394 let local_var_resp = local_var_client.execute(local_var_req).await?;
1395
1396 let local_var_status = local_var_resp.status();
1397 let local_var_content = local_var_resp.text().await?;
1398
1399 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1400 crate::from_str_patched(&local_var_content).map_err(Error::from)
1401 } else {
1402 let local_var_entity: Option<DeleteProtectionRuleError> = crate::from_str_patched(&local_var_content).ok();
1403 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1404 Err(Error::ResponseError(local_var_error))
1405 }
1406}
1407
1408pub async fn delete_workspace(configuration: &configuration::Configuration, workspace: &str, only_delete_forks: Option<bool>) -> Result<String, Error<DeleteWorkspaceError>> {
1409 let local_var_configuration = configuration;
1410
1411 let local_var_client = &local_var_configuration.client;
1412
1413 let local_var_uri_str = format!("{}/workspaces/delete/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1414 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1415
1416 if let Some(ref local_var_str) = only_delete_forks {
1417 local_var_req_builder = local_var_req_builder.query(&[("only_delete_forks", &local_var_str.to_string())]);
1418 }
1419 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1420 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1421 }
1422 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1423 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1424 };
1425
1426 let local_var_req = local_var_req_builder.build()?;
1427 let local_var_resp = local_var_client.execute(local_var_req).await?;
1428
1429 let local_var_status = local_var_resp.status();
1430 let local_var_content = local_var_resp.text().await?;
1431
1432 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1433 crate::from_str_patched(&local_var_content).map_err(Error::from)
1434 } else {
1435 let local_var_entity: Option<DeleteWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
1436 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1437 Err(Error::ResponseError(local_var_error))
1438 }
1439}
1440
1441pub async fn delete_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<DeleteWorkspaceSlackOauthConfigError>> {
1442 let local_var_configuration = configuration;
1443
1444 let local_var_client = &local_var_configuration.client;
1445
1446 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1447 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1448
1449 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1450 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1451 }
1452 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1453 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1454 };
1455
1456 let local_var_req = local_var_req_builder.build()?;
1457 let local_var_resp = local_var_client.execute(local_var_req).await?;
1458
1459 let local_var_status = local_var_resp.status();
1460 let local_var_content = local_var_resp.text().await?;
1461
1462 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1463 crate::from_str_patched(&local_var_content).map_err(Error::from)
1464 } else {
1465 let local_var_entity: Option<DeleteWorkspaceSlackOauthConfigError> = crate::from_str_patched(&local_var_content).ok();
1466 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1467 Err(Error::ResponseError(local_var_error))
1468 }
1469}
1470
1471pub async fn drop_forked_datatable_databases(configuration: &configuration::Configuration, workspace: &str, drop_forked_datatable_databases_request: models::DropForkedDatatableDatabasesRequest) -> Result<Vec<String>, Error<DropForkedDatatableDatabasesError>> {
1472 let local_var_configuration = configuration;
1473
1474 let local_var_client = &local_var_configuration.client;
1475
1476 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/drop_forked_datatable_databases", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1477 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1478
1479 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1480 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1481 }
1482 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1483 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1484 };
1485 local_var_req_builder = local_var_req_builder.json(&drop_forked_datatable_databases_request);
1486
1487 let local_var_req = local_var_req_builder.build()?;
1488 let local_var_resp = local_var_client.execute(local_var_req).await?;
1489
1490 let local_var_status = local_var_resp.status();
1491 let local_var_content = local_var_resp.text().await?;
1492
1493 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1494 crate::from_str_patched(&local_var_content).map_err(Error::from)
1495 } else {
1496 let local_var_entity: Option<DropForkedDatatableDatabasesError> = crate::from_str_patched(&local_var_content).ok();
1497 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1498 Err(Error::ResponseError(local_var_error))
1499 }
1500}
1501
1502pub async fn edit_auto_invite(configuration: &configuration::Configuration, workspace: &str, edit_auto_invite_request: models::EditAutoInviteRequest) -> Result<String, Error<EditAutoInviteError>> {
1503 let local_var_configuration = configuration;
1504
1505 let local_var_client = &local_var_configuration.client;
1506
1507 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_auto_invite", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1508 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1509
1510 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1511 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1512 }
1513 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1514 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1515 };
1516 local_var_req_builder = local_var_req_builder.json(&edit_auto_invite_request);
1517
1518 let local_var_req = local_var_req_builder.build()?;
1519 let local_var_resp = local_var_client.execute(local_var_req).await?;
1520
1521 let local_var_status = local_var_resp.status();
1522 let local_var_content = local_var_resp.text().await?;
1523
1524 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1525 crate::from_str_patched(&local_var_content).map_err(Error::from)
1526 } else {
1527 let local_var_entity: Option<EditAutoInviteError> = crate::from_str_patched(&local_var_content).ok();
1528 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1529 Err(Error::ResponseError(local_var_error))
1530 }
1531}
1532
1533pub async fn edit_copilot_config(configuration: &configuration::Configuration, workspace: &str, ai_config: models::AiConfig) -> Result<models::EditCopilotConfig200Response, Error<EditCopilotConfigError>> {
1534 let local_var_configuration = configuration;
1535
1536 let local_var_client = &local_var_configuration.client;
1537
1538 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_copilot_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1539 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1540
1541 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1542 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1543 }
1544 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1545 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1546 };
1547 local_var_req_builder = local_var_req_builder.json(&ai_config);
1548
1549 let local_var_req = local_var_req_builder.build()?;
1550 let local_var_resp = local_var_client.execute(local_var_req).await?;
1551
1552 let local_var_status = local_var_resp.status();
1553 let local_var_content = local_var_resp.text().await?;
1554
1555 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1556 crate::from_str_patched(&local_var_content).map_err(Error::from)
1557 } else {
1558 let local_var_entity: Option<EditCopilotConfigError> = crate::from_str_patched(&local_var_content).ok();
1559 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1560 Err(Error::ResponseError(local_var_error))
1561 }
1562}
1563
1564pub async fn edit_data_table_config(configuration: &configuration::Configuration, workspace: &str, edit_data_table_config_request: models::EditDataTableConfigRequest) -> Result<serde_json::Value, Error<EditDataTableConfigError>> {
1565 let local_var_configuration = configuration;
1566
1567 let local_var_client = &local_var_configuration.client;
1568
1569 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_datatable_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1570 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1571
1572 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1573 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1574 }
1575 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1576 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1577 };
1578 local_var_req_builder = local_var_req_builder.json(&edit_data_table_config_request);
1579
1580 let local_var_req = local_var_req_builder.build()?;
1581 let local_var_resp = local_var_client.execute(local_var_req).await?;
1582
1583 let local_var_status = local_var_resp.status();
1584 let local_var_content = local_var_resp.text().await?;
1585
1586 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1587 crate::from_str_patched(&local_var_content).map_err(Error::from)
1588 } else {
1589 let local_var_entity: Option<EditDataTableConfigError> = crate::from_str_patched(&local_var_content).ok();
1590 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1591 Err(Error::ResponseError(local_var_error))
1592 }
1593}
1594
1595pub async fn edit_default_scripts(configuration: &configuration::Configuration, workspace: &str, workspace_default_scripts: Option<models::WorkspaceDefaultScripts>) -> Result<String, Error<EditDefaultScriptsError>> {
1596 let local_var_configuration = configuration;
1597
1598 let local_var_client = &local_var_configuration.client;
1599
1600 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1601 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1602
1603 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1604 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1605 }
1606 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1607 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1608 };
1609 local_var_req_builder = local_var_req_builder.json(&workspace_default_scripts);
1610
1611 let local_var_req = local_var_req_builder.build()?;
1612 let local_var_resp = local_var_client.execute(local_var_req).await?;
1613
1614 let local_var_status = local_var_resp.status();
1615 let local_var_content = local_var_resp.text().await?;
1616
1617 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1618 crate::from_str_patched(&local_var_content).map_err(Error::from)
1619 } else {
1620 let local_var_entity: Option<EditDefaultScriptsError> = crate::from_str_patched(&local_var_content).ok();
1621 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1622 Err(Error::ResponseError(local_var_error))
1623 }
1624}
1625
1626pub async fn edit_deploy_to(configuration: &configuration::Configuration, workspace: &str, get_deploy_to200_response: models::GetDeployTo200Response) -> Result<String, Error<EditDeployToError>> {
1627 let local_var_configuration = configuration;
1628
1629 let local_var_client = &local_var_configuration.client;
1630
1631 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1632 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1633
1634 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1635 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1636 }
1637 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1638 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1639 };
1640 local_var_req_builder = local_var_req_builder.json(&get_deploy_to200_response);
1641
1642 let local_var_req = local_var_req_builder.build()?;
1643 let local_var_resp = local_var_client.execute(local_var_req).await?;
1644
1645 let local_var_status = local_var_resp.status();
1646 let local_var_content = local_var_resp.text().await?;
1647
1648 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1649 crate::from_str_patched(&local_var_content).map_err(Error::from)
1650 } else {
1651 let local_var_entity: Option<EditDeployToError> = crate::from_str_patched(&local_var_content).ok();
1652 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1653 Err(Error::ResponseError(local_var_error))
1654 }
1655}
1656
1657pub async fn edit_ducklake_config(configuration: &configuration::Configuration, workspace: &str, edit_ducklake_config_request: models::EditDucklakeConfigRequest) -> Result<serde_json::Value, Error<EditDucklakeConfigError>> {
1658 let local_var_configuration = configuration;
1659
1660 let local_var_client = &local_var_configuration.client;
1661
1662 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_ducklake_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1663 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1664
1665 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1666 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1667 }
1668 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1669 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1670 };
1671 local_var_req_builder = local_var_req_builder.json(&edit_ducklake_config_request);
1672
1673 let local_var_req = local_var_req_builder.build()?;
1674 let local_var_resp = local_var_client.execute(local_var_req).await?;
1675
1676 let local_var_status = local_var_resp.status();
1677 let local_var_content = local_var_resp.text().await?;
1678
1679 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1680 crate::from_str_patched(&local_var_content).map_err(Error::from)
1681 } else {
1682 let local_var_entity: Option<EditDucklakeConfigError> = crate::from_str_patched(&local_var_content).ok();
1683 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1684 Err(Error::ResponseError(local_var_error))
1685 }
1686}
1687
1688pub async fn edit_error_handler(configuration: &configuration::Configuration, workspace: &str, edit_error_handler: models::EditErrorHandler) -> Result<String, Error<EditErrorHandlerError>> {
1689 let local_var_configuration = configuration;
1690
1691 let local_var_client = &local_var_configuration.client;
1692
1693 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_error_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1694 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1695
1696 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1697 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1698 }
1699 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1700 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1701 };
1702 local_var_req_builder = local_var_req_builder.json(&edit_error_handler);
1703
1704 let local_var_req = local_var_req_builder.build()?;
1705 let local_var_resp = local_var_client.execute(local_var_req).await?;
1706
1707 let local_var_status = local_var_resp.status();
1708 let local_var_content = local_var_resp.text().await?;
1709
1710 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1711 crate::from_str_patched(&local_var_content).map_err(Error::from)
1712 } else {
1713 let local_var_entity: Option<EditErrorHandlerError> = crate::from_str_patched(&local_var_content).ok();
1714 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1715 Err(Error::ResponseError(local_var_error))
1716 }
1717}
1718
1719pub async fn edit_git_sync_repository(configuration: &configuration::Configuration, workspace: &str, edit_git_sync_repository_request: models::EditGitSyncRepositoryRequest) -> Result<serde_json::Value, Error<EditGitSyncRepositoryError>> {
1720 let local_var_configuration = configuration;
1721
1722 let local_var_client = &local_var_configuration.client;
1723
1724 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_repository", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1725 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1726
1727 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1728 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1729 }
1730 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1731 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1732 };
1733 local_var_req_builder = local_var_req_builder.json(&edit_git_sync_repository_request);
1734
1735 let local_var_req = local_var_req_builder.build()?;
1736 let local_var_resp = local_var_client.execute(local_var_req).await?;
1737
1738 let local_var_status = local_var_resp.status();
1739 let local_var_content = local_var_resp.text().await?;
1740
1741 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1742 crate::from_str_patched(&local_var_content).map_err(Error::from)
1743 } else {
1744 let local_var_entity: Option<EditGitSyncRepositoryError> = crate::from_str_patched(&local_var_content).ok();
1745 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1746 Err(Error::ResponseError(local_var_error))
1747 }
1748}
1749
1750pub async fn edit_instance_groups(configuration: &configuration::Configuration, workspace: &str, edit_instance_groups_request: models::EditInstanceGroupsRequest) -> Result<String, Error<EditInstanceGroupsError>> {
1751 let local_var_configuration = configuration;
1752
1753 let local_var_client = &local_var_configuration.client;
1754
1755 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_instance_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1756 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1757
1758 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1759 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1760 }
1761 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1762 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1763 };
1764 local_var_req_builder = local_var_req_builder.json(&edit_instance_groups_request);
1765
1766 let local_var_req = local_var_req_builder.build()?;
1767 let local_var_resp = local_var_client.execute(local_var_req).await?;
1768
1769 let local_var_status = local_var_resp.status();
1770 let local_var_content = local_var_resp.text().await?;
1771
1772 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1773 crate::from_str_patched(&local_var_content).map_err(Error::from)
1774 } else {
1775 let local_var_entity: Option<EditInstanceGroupsError> = crate::from_str_patched(&local_var_content).ok();
1776 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1777 Err(Error::ResponseError(local_var_error))
1778 }
1779}
1780
1781pub 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>> {
1782 let local_var_configuration = configuration;
1783
1784 let local_var_client = &local_var_configuration.client;
1785
1786 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_large_file_storage_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1787 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1788
1789 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1790 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1791 }
1792 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1793 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1794 };
1795 local_var_req_builder = local_var_req_builder.json(&edit_large_file_storage_config_request);
1796
1797 let local_var_req = local_var_req_builder.build()?;
1798 let local_var_resp = local_var_client.execute(local_var_req).await?;
1799
1800 let local_var_status = local_var_resp.status();
1801 let local_var_content = local_var_resp.text().await?;
1802
1803 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1804 crate::from_str_patched(&local_var_content).map_err(Error::from)
1805 } else {
1806 let local_var_entity: Option<EditLargeFileStorageConfigError> = crate::from_str_patched(&local_var_content).ok();
1807 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1808 Err(Error::ResponseError(local_var_error))
1809 }
1810}
1811
1812pub async fn edit_slack_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditSlackCommandError>> {
1813 let local_var_configuration = configuration;
1814
1815 let local_var_client = &local_var_configuration.client;
1816
1817 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_slack_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1818 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1819
1820 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1821 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1822 }
1823 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1824 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1825 };
1826 local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1827
1828 let local_var_req = local_var_req_builder.build()?;
1829 let local_var_resp = local_var_client.execute(local_var_req).await?;
1830
1831 let local_var_status = local_var_resp.status();
1832 let local_var_content = local_var_resp.text().await?;
1833
1834 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1835 crate::from_str_patched(&local_var_content).map_err(Error::from)
1836 } else {
1837 let local_var_entity: Option<EditSlackCommandError> = crate::from_str_patched(&local_var_content).ok();
1838 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1839 Err(Error::ResponseError(local_var_error))
1840 }
1841}
1842
1843pub async fn edit_success_handler(configuration: &configuration::Configuration, workspace: &str, edit_success_handler: models::EditSuccessHandler) -> Result<String, Error<EditSuccessHandlerError>> {
1844 let local_var_configuration = configuration;
1845
1846 let local_var_client = &local_var_configuration.client;
1847
1848 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_success_handler", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1849 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1850
1851 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1852 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1853 }
1854 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1855 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1856 };
1857 local_var_req_builder = local_var_req_builder.json(&edit_success_handler);
1858
1859 let local_var_req = local_var_req_builder.build()?;
1860 let local_var_resp = local_var_client.execute(local_var_req).await?;
1861
1862 let local_var_status = local_var_resp.status();
1863 let local_var_content = local_var_resp.text().await?;
1864
1865 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1866 crate::from_str_patched(&local_var_content).map_err(Error::from)
1867 } else {
1868 let local_var_entity: Option<EditSuccessHandlerError> = crate::from_str_patched(&local_var_content).ok();
1869 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1870 Err(Error::ResponseError(local_var_error))
1871 }
1872}
1873
1874pub async fn edit_teams_command(configuration: &configuration::Configuration, workspace: &str, edit_slack_command_request: models::EditSlackCommandRequest) -> Result<String, Error<EditTeamsCommandError>> {
1875 let local_var_configuration = configuration;
1876
1877 let local_var_client = &local_var_configuration.client;
1878
1879 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_teams_command", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1880 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1881
1882 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1883 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1884 }
1885 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1886 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1887 };
1888 local_var_req_builder = local_var_req_builder.json(&edit_slack_command_request);
1889
1890 let local_var_req = local_var_req_builder.build()?;
1891 let local_var_resp = local_var_client.execute(local_var_req).await?;
1892
1893 let local_var_status = local_var_resp.status();
1894 let local_var_content = local_var_resp.text().await?;
1895
1896 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1897 crate::from_str_patched(&local_var_content).map_err(Error::from)
1898 } else {
1899 let local_var_entity: Option<EditTeamsCommandError> = crate::from_str_patched(&local_var_content).ok();
1900 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1901 Err(Error::ResponseError(local_var_error))
1902 }
1903}
1904
1905pub async fn edit_webhook(configuration: &configuration::Configuration, workspace: &str, edit_webhook_request: models::EditWebhookRequest) -> Result<String, Error<EditWebhookError>> {
1906 let local_var_configuration = configuration;
1907
1908 let local_var_client = &local_var_configuration.client;
1909
1910 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_webhook", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1911 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1912
1913 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1914 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1915 }
1916 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1917 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1918 };
1919 local_var_req_builder = local_var_req_builder.json(&edit_webhook_request);
1920
1921 let local_var_req = local_var_req_builder.build()?;
1922 let local_var_resp = local_var_client.execute(local_var_req).await?;
1923
1924 let local_var_status = local_var_resp.status();
1925 let local_var_content = local_var_resp.text().await?;
1926
1927 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1928 crate::from_str_patched(&local_var_content).map_err(Error::from)
1929 } else {
1930 let local_var_entity: Option<EditWebhookError> = crate::from_str_patched(&local_var_content).ok();
1931 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1932 Err(Error::ResponseError(local_var_error))
1933 }
1934}
1935
1936pub async fn edit_workspace_default_app(configuration: &configuration::Configuration, workspace: &str, edit_workspace_default_app_request: models::EditWorkspaceDefaultAppRequest) -> Result<String, Error<EditWorkspaceDefaultAppError>> {
1937 let local_var_configuration = configuration;
1938
1939 let local_var_client = &local_var_configuration.client;
1940
1941 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1942 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1943
1944 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1945 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1946 }
1947 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1948 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1949 };
1950 local_var_req_builder = local_var_req_builder.json(&edit_workspace_default_app_request);
1951
1952 let local_var_req = local_var_req_builder.build()?;
1953 let local_var_resp = local_var_client.execute(local_var_req).await?;
1954
1955 let local_var_status = local_var_resp.status();
1956 let local_var_content = local_var_resp.text().await?;
1957
1958 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1959 crate::from_str_patched(&local_var_content).map_err(Error::from)
1960 } else {
1961 let local_var_entity: Option<EditWorkspaceDefaultAppError> = crate::from_str_patched(&local_var_content).ok();
1962 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1963 Err(Error::ResponseError(local_var_error))
1964 }
1965}
1966
1967pub 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>> {
1968 let local_var_configuration = configuration;
1969
1970 let local_var_client = &local_var_configuration.client;
1971
1972 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_deploy_ui_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1973 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1974
1975 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1976 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1977 }
1978 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1979 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1980 };
1981 local_var_req_builder = local_var_req_builder.json(&edit_workspace_deploy_ui_settings_request);
1982
1983 let local_var_req = local_var_req_builder.build()?;
1984 let local_var_resp = local_var_client.execute(local_var_req).await?;
1985
1986 let local_var_status = local_var_resp.status();
1987 let local_var_content = local_var_resp.text().await?;
1988
1989 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1990 crate::from_str_patched(&local_var_content).map_err(Error::from)
1991 } else {
1992 let local_var_entity: Option<EditWorkspaceDeployUiSettingsError> = crate::from_str_patched(&local_var_content).ok();
1993 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1994 Err(Error::ResponseError(local_var_error))
1995 }
1996}
1997
1998pub 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>> {
1999 let local_var_configuration = configuration;
2000
2001 let local_var_client = &local_var_configuration.client;
2002
2003 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/edit_git_sync_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2004 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2005
2006 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2007 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2008 }
2009 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2010 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2011 };
2012 local_var_req_builder = local_var_req_builder.json(&edit_workspace_git_sync_config_request);
2013
2014 let local_var_req = local_var_req_builder.build()?;
2015 let local_var_resp = local_var_client.execute(local_var_req).await?;
2016
2017 let local_var_status = local_var_resp.status();
2018 let local_var_content = local_var_resp.text().await?;
2019
2020 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2021 crate::from_str_patched(&local_var_content).map_err(Error::from)
2022 } else {
2023 let local_var_entity: Option<EditWorkspaceGitSyncConfigError> = crate::from_str_patched(&local_var_content).ok();
2024 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2025 Err(Error::ResponseError(local_var_error))
2026 }
2027}
2028
2029pub async fn exists_username(configuration: &configuration::Configuration, exists_username_request: models::ExistsUsernameRequest) -> Result<bool, Error<ExistsUsernameError>> {
2030 let local_var_configuration = configuration;
2031
2032 let local_var_client = &local_var_configuration.client;
2033
2034 let local_var_uri_str = format!("{}/workspaces/exists_username", local_var_configuration.base_path);
2035 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2036
2037 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2038 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2039 }
2040 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2041 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2042 };
2043 local_var_req_builder = local_var_req_builder.json(&exists_username_request);
2044
2045 let local_var_req = local_var_req_builder.build()?;
2046 let local_var_resp = local_var_client.execute(local_var_req).await?;
2047
2048 let local_var_status = local_var_resp.status();
2049 let local_var_content = local_var_resp.text().await?;
2050
2051 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2052 crate::from_str_patched(&local_var_content).map_err(Error::from)
2053 } else {
2054 let local_var_entity: Option<ExistsUsernameError> = crate::from_str_patched(&local_var_content).ok();
2055 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2056 Err(Error::ResponseError(local_var_error))
2057 }
2058}
2059
2060pub async fn exists_workspace(configuration: &configuration::Configuration, exists_workspace_request: models::ExistsWorkspaceRequest) -> Result<bool, Error<ExistsWorkspaceError>> {
2061 let local_var_configuration = configuration;
2062
2063 let local_var_client = &local_var_configuration.client;
2064
2065 let local_var_uri_str = format!("{}/workspaces/exists", local_var_configuration.base_path);
2066 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2067
2068 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2069 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2070 }
2071 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2072 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2073 };
2074 local_var_req_builder = local_var_req_builder.json(&exists_workspace_request);
2075
2076 let local_var_req = local_var_req_builder.build()?;
2077 let local_var_resp = local_var_client.execute(local_var_req).await?;
2078
2079 let local_var_status = local_var_resp.status();
2080 let local_var_content = local_var_resp.text().await?;
2081
2082 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2083 crate::from_str_patched(&local_var_content).map_err(Error::from)
2084 } else {
2085 let local_var_entity: Option<ExistsWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
2086 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2087 Err(Error::ResponseError(local_var_error))
2088 }
2089}
2090
2091pub async fn export_pg_schema(configuration: &configuration::Configuration, workspace: &str, export_pg_schema_request: models::ExportPgSchemaRequest) -> Result<String, Error<ExportPgSchemaError>> {
2092 let local_var_configuration = configuration;
2093
2094 let local_var_client = &local_var_configuration.client;
2095
2096 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/export_pg_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2097 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2098
2099 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2100 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2101 }
2102 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2103 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2104 };
2105 local_var_req_builder = local_var_req_builder.json(&export_pg_schema_request);
2106
2107 let local_var_req = local_var_req_builder.build()?;
2108 let local_var_resp = local_var_client.execute(local_var_req).await?;
2109
2110 let local_var_status = local_var_resp.status();
2111 let local_var_content = local_var_resp.text().await?;
2112
2113 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2114 crate::from_str_patched(&local_var_content).map_err(Error::from)
2115 } else {
2116 let local_var_entity: Option<ExportPgSchemaError> = crate::from_str_patched(&local_var_content).ok();
2117 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2118 Err(Error::ResponseError(local_var_error))
2119 }
2120}
2121
2122pub async fn get_cloud_quotas(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCloudQuotas200Response, Error<GetCloudQuotasError>> {
2123 let local_var_configuration = configuration;
2124
2125 let local_var_client = &local_var_configuration.client;
2126
2127 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/cloud_quotas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2128 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2129
2130 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2131 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2132 }
2133 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2134 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2135 };
2136
2137 let local_var_req = local_var_req_builder.build()?;
2138 let local_var_resp = local_var_client.execute(local_var_req).await?;
2139
2140 let local_var_status = local_var_resp.status();
2141 let local_var_content = local_var_resp.text().await?;
2142
2143 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2144 crate::from_str_patched(&local_var_content).map_err(Error::from)
2145 } else {
2146 let local_var_entity: Option<GetCloudQuotasError> = crate::from_str_patched(&local_var_content).ok();
2147 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2148 Err(Error::ResponseError(local_var_error))
2149 }
2150}
2151
2152pub async fn get_copilot_info(configuration: &configuration::Configuration, workspace: &str) -> Result<models::AiConfig, Error<GetCopilotInfoError>> {
2153 let local_var_configuration = configuration;
2154
2155 let local_var_client = &local_var_configuration.client;
2156
2157 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2158 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2159
2160 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2161 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2162 }
2163 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2164 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2165 };
2166
2167 let local_var_req = local_var_req_builder.build()?;
2168 let local_var_resp = local_var_client.execute(local_var_req).await?;
2169
2170 let local_var_status = local_var_resp.status();
2171 let local_var_content = local_var_resp.text().await?;
2172
2173 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2174 crate::from_str_patched(&local_var_content).map_err(Error::from)
2175 } else {
2176 let local_var_entity: Option<GetCopilotInfoError> = crate::from_str_patched(&local_var_content).ok();
2177 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2178 Err(Error::ResponseError(local_var_error))
2179 }
2180}
2181
2182pub async fn get_copilot_settings_state(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCopilotSettingsState200Response, Error<GetCopilotSettingsStateError>> {
2183 let local_var_configuration = configuration;
2184
2185 let local_var_client = &local_var_configuration.client;
2186
2187 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_copilot_settings_state", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2188 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2189
2190 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2191 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2192 }
2193 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2194 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2195 };
2196
2197 let local_var_req = local_var_req_builder.build()?;
2198 let local_var_resp = local_var_client.execute(local_var_req).await?;
2199
2200 let local_var_status = local_var_resp.status();
2201 let local_var_content = local_var_resp.text().await?;
2202
2203 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2204 crate::from_str_patched(&local_var_content).map_err(Error::from)
2205 } else {
2206 let local_var_entity: Option<GetCopilotSettingsStateError> = crate::from_str_patched(&local_var_content).ok();
2207 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2208 Err(Error::ResponseError(local_var_error))
2209 }
2210}
2211
2212pub async fn get_data_table_table_schema(configuration: &configuration::Configuration, workspace: &str, datatable_name: &str, schema_name: &str, table_name: &str) -> Result<models::DataTableTableSchema, Error<GetDataTableTableSchemaError>> {
2213 let local_var_configuration = configuration;
2214
2215 let local_var_client = &local_var_configuration.client;
2216
2217 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_table_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2218 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2219
2220 local_var_req_builder = local_var_req_builder.query(&[("datatable_name", &datatable_name.to_string())]);
2221 local_var_req_builder = local_var_req_builder.query(&[("schema_name", &schema_name.to_string())]);
2222 local_var_req_builder = local_var_req_builder.query(&[("table_name", &table_name.to_string())]);
2223 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2224 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2225 }
2226 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2227 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2228 };
2229
2230 let local_var_req = local_var_req_builder.build()?;
2231 let local_var_resp = local_var_client.execute(local_var_req).await?;
2232
2233 let local_var_status = local_var_resp.status();
2234 let local_var_content = local_var_resp.text().await?;
2235
2236 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2237 crate::from_str_patched(&local_var_content).map_err(Error::from)
2238 } else {
2239 let local_var_entity: Option<GetDataTableTableSchemaError> = crate::from_str_patched(&local_var_content).ok();
2240 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2241 Err(Error::ResponseError(local_var_error))
2242 }
2243}
2244
2245pub async fn get_datatable_full_schema(configuration: &configuration::Configuration, workspace: &str, get_datatable_full_schema_request: models::GetDatatableFullSchemaRequest) -> Result<std::collections::HashMap<String, std::collections::HashMap<String, models::GetDatatableFullSchema200ResponseValueValue>>, Error<GetDatatableFullSchemaError>> {
2246 let local_var_configuration = configuration;
2247
2248 let local_var_client = &local_var_configuration.client;
2249
2250 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_datatable_full_schema", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2251 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2252
2253 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2254 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2255 }
2256 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2257 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2258 };
2259 local_var_req_builder = local_var_req_builder.json(&get_datatable_full_schema_request);
2260
2261 let local_var_req = local_var_req_builder.build()?;
2262 let local_var_resp = local_var_client.execute(local_var_req).await?;
2263
2264 let local_var_status = local_var_resp.status();
2265 let local_var_content = local_var_resp.text().await?;
2266
2267 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2268 crate::from_str_patched(&local_var_content).map_err(Error::from)
2269 } else {
2270 let local_var_entity: Option<GetDatatableFullSchemaError> = crate::from_str_patched(&local_var_content).ok();
2271 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2272 Err(Error::ResponseError(local_var_error))
2273 }
2274}
2275
2276pub async fn get_default_scripts(configuration: &configuration::Configuration, workspace: &str) -> Result<models::WorkspaceDefaultScripts, Error<GetDefaultScriptsError>> {
2277 let local_var_configuration = configuration;
2278
2279 let local_var_client = &local_var_configuration.client;
2280
2281 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2282 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2283
2284 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2285 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2286 }
2287 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2288 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2289 };
2290
2291 let local_var_req = local_var_req_builder.build()?;
2292 let local_var_resp = local_var_client.execute(local_var_req).await?;
2293
2294 let local_var_status = local_var_resp.status();
2295 let local_var_content = local_var_resp.text().await?;
2296
2297 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2298 crate::from_str_patched(&local_var_content).map_err(Error::from)
2299 } else {
2300 let local_var_entity: Option<GetDefaultScriptsError> = crate::from_str_patched(&local_var_content).ok();
2301 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2302 Err(Error::ResponseError(local_var_error))
2303 }
2304}
2305
2306pub async fn get_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DependencyMap>, Error<GetDependencyMapError>> {
2307 let local_var_configuration = configuration;
2308
2309 let local_var_client = &local_var_configuration.client;
2310
2311 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2312 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2313
2314 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2315 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2316 }
2317 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2318 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2319 };
2320
2321 let local_var_req = local_var_req_builder.build()?;
2322 let local_var_resp = local_var_client.execute(local_var_req).await?;
2323
2324 let local_var_status = local_var_resp.status();
2325 let local_var_content = local_var_resp.text().await?;
2326
2327 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2328 crate::from_str_patched(&local_var_content).map_err(Error::from)
2329 } else {
2330 let local_var_entity: Option<GetDependencyMapError> = crate::from_str_patched(&local_var_content).ok();
2331 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2332 Err(Error::ResponseError(local_var_error))
2333 }
2334}
2335
2336pub async fn get_dependents(configuration: &configuration::Configuration, workspace: &str, imported_path: &str) -> Result<Vec<models::DependencyDependent>, Error<GetDependentsError>> {
2337 let local_var_configuration = configuration;
2338
2339 let local_var_client = &local_var_configuration.client;
2340
2341 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));
2342 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2343
2344 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2345 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2346 }
2347 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2348 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2349 };
2350
2351 let local_var_req = local_var_req_builder.build()?;
2352 let local_var_resp = local_var_client.execute(local_var_req).await?;
2353
2354 let local_var_status = local_var_resp.status();
2355 let local_var_content = local_var_resp.text().await?;
2356
2357 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2358 crate::from_str_patched(&local_var_content).map_err(Error::from)
2359 } else {
2360 let local_var_entity: Option<GetDependentsError> = crate::from_str_patched(&local_var_content).ok();
2361 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2362 Err(Error::ResponseError(local_var_error))
2363 }
2364}
2365
2366pub async fn get_dependents_amounts(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<models::DependentsAmount>, Error<GetDependentsAmountsError>> {
2367 let local_var_configuration = configuration;
2368
2369 let local_var_client = &local_var_configuration.client;
2370
2371 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_dependents_amounts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2372 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2373
2374 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2375 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2376 }
2377 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2378 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2379 };
2380 local_var_req_builder = local_var_req_builder.json(&request_body);
2381
2382 let local_var_req = local_var_req_builder.build()?;
2383 let local_var_resp = local_var_client.execute(local_var_req).await?;
2384
2385 let local_var_status = local_var_resp.status();
2386 let local_var_content = local_var_resp.text().await?;
2387
2388 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2389 crate::from_str_patched(&local_var_content).map_err(Error::from)
2390 } else {
2391 let local_var_entity: Option<GetDependentsAmountsError> = crate::from_str_patched(&local_var_content).ok();
2392 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2393 Err(Error::ResponseError(local_var_error))
2394 }
2395}
2396
2397pub async fn get_deploy_to(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetDeployTo200Response, Error<GetDeployToError>> {
2398 let local_var_configuration = configuration;
2399
2400 let local_var_client = &local_var_configuration.client;
2401
2402 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_deploy_to", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2403 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2404
2405 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2406 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2407 }
2408 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2409 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2410 };
2411
2412 let local_var_req = local_var_req_builder.build()?;
2413 let local_var_resp = local_var_client.execute(local_var_req).await?;
2414
2415 let local_var_status = local_var_resp.status();
2416 let local_var_content = local_var_resp.text().await?;
2417
2418 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2419 crate::from_str_patched(&local_var_content).map_err(Error::from)
2420 } else {
2421 let local_var_entity: Option<GetDeployToError> = crate::from_str_patched(&local_var_content).ok();
2422 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2423 Err(Error::ResponseError(local_var_error))
2424 }
2425}
2426
2427pub async fn get_git_sync_enabled(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetGitSyncEnabled200Response, Error<GetGitSyncEnabledError>> {
2428 let local_var_configuration = configuration;
2429
2430 let local_var_client = &local_var_configuration.client;
2431
2432 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/git_sync_enabled", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2433 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2434
2435 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2436 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2437 }
2438 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2439 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2440 };
2441
2442 let local_var_req = local_var_req_builder.build()?;
2443 let local_var_resp = local_var_client.execute(local_var_req).await?;
2444
2445 let local_var_status = local_var_resp.status();
2446 let local_var_content = local_var_resp.text().await?;
2447
2448 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2449 crate::from_str_patched(&local_var_content).map_err(Error::from)
2450 } else {
2451 let local_var_entity: Option<GetGitSyncEnabledError> = crate::from_str_patched(&local_var_content).ok();
2452 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2453 Err(Error::ResponseError(local_var_error))
2454 }
2455}
2456
2457pub async fn get_github_app_token(configuration: &configuration::Configuration, workspace: &str, get_github_app_token_request: models::GetGithubAppTokenRequest) -> Result<models::GetGithubAppToken200Response, Error<GetGithubAppTokenError>> {
2458 let local_var_configuration = configuration;
2459
2460 let local_var_client = &local_var_configuration.client;
2461
2462 let local_var_uri_str = format!("{}/w/{workspace}/github_app/token", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2463 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2464
2465 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2466 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2467 }
2468 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2469 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2470 };
2471 local_var_req_builder = local_var_req_builder.json(&get_github_app_token_request);
2472
2473 let local_var_req = local_var_req_builder.build()?;
2474 let local_var_resp = local_var_client.execute(local_var_req).await?;
2475
2476 let local_var_status = local_var_resp.status();
2477 let local_var_content = local_var_resp.text().await?;
2478
2479 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2480 crate::from_str_patched(&local_var_content).map_err(Error::from)
2481 } else {
2482 let local_var_entity: Option<GetGithubAppTokenError> = crate::from_str_patched(&local_var_content).ok();
2483 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2484 Err(Error::ResponseError(local_var_error))
2485 }
2486}
2487
2488pub async fn get_imports(configuration: &configuration::Configuration, workspace: &str, importer_path: &str) -> Result<Vec<String>, Error<GetImportsError>> {
2489 let local_var_configuration = configuration;
2490
2491 let local_var_client = &local_var_configuration.client;
2492
2493 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_imports/{importer_path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), importer_path=crate::apis::urlencode(importer_path));
2494 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2495
2496 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2497 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2498 }
2499 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2500 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2501 };
2502
2503 let local_var_req = local_var_req_builder.build()?;
2504 let local_var_resp = local_var_client.execute(local_var_req).await?;
2505
2506 let local_var_status = local_var_resp.status();
2507 let local_var_content = local_var_resp.text().await?;
2508
2509 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2510 crate::from_str_patched(&local_var_content).map_err(Error::from)
2511 } else {
2512 let local_var_entity: Option<GetImportsError> = crate::from_str_patched(&local_var_content).ok();
2513 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2514 Err(Error::ResponseError(local_var_error))
2515 }
2516}
2517
2518pub async fn get_is_premium(configuration: &configuration::Configuration, workspace: &str) -> Result<bool, Error<GetIsPremiumError>> {
2519 let local_var_configuration = configuration;
2520
2521 let local_var_client = &local_var_configuration.client;
2522
2523 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/is_premium", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2524 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2525
2526 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2527 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2528 }
2529 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2530 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2531 };
2532
2533 let local_var_req = local_var_req_builder.build()?;
2534 let local_var_resp = local_var_client.execute(local_var_req).await?;
2535
2536 let local_var_status = local_var_resp.status();
2537 let local_var_content = local_var_resp.text().await?;
2538
2539 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2540 crate::from_str_patched(&local_var_content).map_err(Error::from)
2541 } else {
2542 let local_var_entity: Option<GetIsPremiumError> = crate::from_str_patched(&local_var_content).ok();
2543 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2544 Err(Error::ResponseError(local_var_error))
2545 }
2546}
2547
2548pub async fn get_open_deployment_request(configuration: &configuration::Configuration, workspace: &str) -> Result<models::DeploymentRequest, Error<GetOpenDeploymentRequestError>> {
2549 let local_var_configuration = configuration;
2550
2551 let local_var_client = &local_var_configuration.client;
2552
2553 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/open", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2554 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2555
2556 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2557 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2558 }
2559 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2560 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2561 };
2562
2563 let local_var_req = local_var_req_builder.build()?;
2564 let local_var_resp = local_var_client.execute(local_var_req).await?;
2565
2566 let local_var_status = local_var_resp.status();
2567 let local_var_content = local_var_resp.text().await?;
2568
2569 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2570 crate::from_str_patched(&local_var_content).map_err(Error::from)
2571 } else {
2572 let local_var_entity: Option<GetOpenDeploymentRequestError> = crate::from_str_patched(&local_var_content).ok();
2573 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2574 Err(Error::ResponseError(local_var_error))
2575 }
2576}
2577
2578pub async fn get_public_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetPublicSettings200Response, Error<GetPublicSettingsError>> {
2580 let local_var_configuration = configuration;
2581
2582 let local_var_client = &local_var_configuration.client;
2583
2584 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_public_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2585 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2586
2587 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2588 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2589 }
2590 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2591 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2592 };
2593
2594 let local_var_req = local_var_req_builder.build()?;
2595 let local_var_resp = local_var_client.execute(local_var_req).await?;
2596
2597 let local_var_status = local_var_resp.status();
2598 let local_var_content = local_var_resp.text().await?;
2599
2600 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2601 crate::from_str_patched(&local_var_content).map_err(Error::from)
2602 } else {
2603 let local_var_entity: Option<GetPublicSettingsError> = crate::from_str_patched(&local_var_content).ok();
2604 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2605 Err(Error::ResponseError(local_var_error))
2606 }
2607}
2608
2609pub async fn get_settings(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSettings200Response, Error<GetSettingsError>> {
2611 let local_var_configuration = configuration;
2612
2613 let local_var_client = &local_var_configuration.client;
2614
2615 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2616 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2617
2618 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2619 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2620 }
2621 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2622 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2623 };
2624
2625 let local_var_req = local_var_req_builder.build()?;
2626 let local_var_resp = local_var_client.execute(local_var_req).await?;
2627
2628 let local_var_status = local_var_resp.status();
2629 let local_var_content = local_var_resp.text().await?;
2630
2631 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2632 crate::from_str_patched(&local_var_content).map_err(Error::from)
2633 } else {
2634 let local_var_entity: Option<GetSettingsError> = crate::from_str_patched(&local_var_content).ok();
2635 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2636 Err(Error::ResponseError(local_var_error))
2637 }
2638}
2639
2640pub async fn get_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUi200Response, Error<GetSharedUiError>> {
2641 let local_var_configuration = configuration;
2642
2643 let local_var_client = &local_var_configuration.client;
2644
2645 let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/get", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2646 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2647
2648 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2649 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2650 }
2651 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2652 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2653 };
2654
2655 let local_var_req = local_var_req_builder.build()?;
2656 let local_var_resp = local_var_client.execute(local_var_req).await?;
2657
2658 let local_var_status = local_var_resp.status();
2659 let local_var_content = local_var_resp.text().await?;
2660
2661 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2662 crate::from_str_patched(&local_var_content).map_err(Error::from)
2663 } else {
2664 let local_var_entity: Option<GetSharedUiError> = crate::from_str_patched(&local_var_content).ok();
2665 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2666 Err(Error::ResponseError(local_var_error))
2667 }
2668}
2669
2670pub async fn get_shared_ui_version(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetSharedUiVersion200Response, Error<GetSharedUiVersionError>> {
2671 let local_var_configuration = configuration;
2672
2673 let local_var_client = &local_var_configuration.client;
2674
2675 let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/version", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2676 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2677
2678 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2679 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2680 }
2681 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2682 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2683 };
2684
2685 let local_var_req = local_var_req_builder.build()?;
2686 let local_var_resp = local_var_client.execute(local_var_req).await?;
2687
2688 let local_var_status = local_var_resp.status();
2689 let local_var_content = local_var_resp.text().await?;
2690
2691 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2692 crate::from_str_patched(&local_var_content).map_err(Error::from)
2693 } else {
2694 let local_var_entity: Option<GetSharedUiVersionError> = crate::from_str_patched(&local_var_content).ok();
2695 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2696 Err(Error::ResponseError(local_var_error))
2697 }
2698}
2699
2700pub async fn get_threshold_alert(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetThresholdAlert200Response, Error<GetThresholdAlertError>> {
2701 let local_var_configuration = configuration;
2702
2703 let local_var_client = &local_var_configuration.client;
2704
2705 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2706 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2707
2708 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2709 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2710 }
2711 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2712 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2713 };
2714
2715 let local_var_req = local_var_req_builder.build()?;
2716 let local_var_resp = local_var_client.execute(local_var_req).await?;
2717
2718 let local_var_status = local_var_resp.status();
2719 let local_var_content = local_var_resp.text().await?;
2720
2721 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2722 crate::from_str_patched(&local_var_content).map_err(Error::from)
2723 } else {
2724 let local_var_entity: Option<GetThresholdAlertError> = crate::from_str_patched(&local_var_content).ok();
2725 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2726 Err(Error::ResponseError(local_var_error))
2727 }
2728}
2729
2730pub async fn get_used_triggers(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetUsedTriggers200Response, Error<GetUsedTriggersError>> {
2731 let local_var_configuration = configuration;
2732
2733 let local_var_client = &local_var_configuration.client;
2734
2735 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/used_triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2736 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2737
2738 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2739 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2740 }
2741 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2742 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2743 };
2744
2745 let local_var_req = local_var_req_builder.build()?;
2746 let local_var_resp = local_var_client.execute(local_var_req).await?;
2747
2748 let local_var_status = local_var_resp.status();
2749 let local_var_content = local_var_resp.text().await?;
2750
2751 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2752 crate::from_str_patched(&local_var_content).map_err(Error::from)
2753 } else {
2754 let local_var_entity: Option<GetUsedTriggersError> = crate::from_str_patched(&local_var_content).ok();
2755 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2756 Err(Error::ResponseError(local_var_error))
2757 }
2758}
2759
2760pub async fn get_workspace_as_super_admin(configuration: &configuration::Configuration, workspace: &str) -> Result<models::Workspace, Error<GetWorkspaceAsSuperAdminError>> {
2761 let local_var_configuration = configuration;
2762
2763 let local_var_client = &local_var_configuration.client;
2764
2765 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_as_superadmin", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2766 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2767
2768 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2769 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2770 }
2771 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2772 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2773 };
2774
2775 let local_var_req = local_var_req_builder.build()?;
2776 let local_var_resp = local_var_client.execute(local_var_req).await?;
2777
2778 let local_var_status = local_var_resp.status();
2779 let local_var_content = local_var_resp.text().await?;
2780
2781 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2782 crate::from_str_patched(&local_var_content).map_err(Error::from)
2783 } else {
2784 let local_var_entity: Option<GetWorkspaceAsSuperAdminError> = crate::from_str_patched(&local_var_content).ok();
2785 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2786 Err(Error::ResponseError(local_var_error))
2787 }
2788}
2789
2790pub async fn get_workspace_default_app(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceDefaultApp200Response, Error<GetWorkspaceDefaultAppError>> {
2791 let local_var_configuration = configuration;
2792
2793 let local_var_client = &local_var_configuration.client;
2794
2795 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/default_app", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2796 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2797
2798 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2799 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2800 }
2801 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2802 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2803 };
2804
2805 let local_var_req = local_var_req_builder.build()?;
2806 let local_var_resp = local_var_client.execute(local_var_req).await?;
2807
2808 let local_var_status = local_var_resp.status();
2809 let local_var_content = local_var_resp.text().await?;
2810
2811 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2812 crate::from_str_patched(&local_var_content).map_err(Error::from)
2813 } else {
2814 let local_var_entity: Option<GetWorkspaceDefaultAppError> = crate::from_str_patched(&local_var_content).ok();
2815 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2816 Err(Error::ResponseError(local_var_error))
2817 }
2818}
2819
2820pub async fn get_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceEncryptionKey200Response, Error<GetWorkspaceEncryptionKeyError>> {
2821 let local_var_configuration = configuration;
2822
2823 let local_var_client = &local_var_configuration.client;
2824
2825 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2826 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2827
2828 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2829 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2830 }
2831 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2832 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2833 };
2834
2835 let local_var_req = local_var_req_builder.build()?;
2836 let local_var_resp = local_var_client.execute(local_var_req).await?;
2837
2838 let local_var_status = local_var_resp.status();
2839 let local_var_content = local_var_resp.text().await?;
2840
2841 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2842 crate::from_str_patched(&local_var_content).map_err(Error::from)
2843 } else {
2844 let local_var_entity: Option<GetWorkspaceEncryptionKeyError> = crate::from_str_patched(&local_var_content).ok();
2845 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2846 Err(Error::ResponseError(local_var_error))
2847 }
2848}
2849
2850pub async fn get_workspace_name(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<GetWorkspaceNameError>> {
2851 let local_var_configuration = configuration;
2852
2853 let local_var_client = &local_var_configuration.client;
2854
2855 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/get_workspace_name", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2856 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2857
2858 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2859 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2860 }
2861 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2862 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2863 };
2864
2865 let local_var_req = local_var_req_builder.build()?;
2866 let local_var_resp = local_var_client.execute(local_var_req).await?;
2867
2868 let local_var_status = local_var_resp.status();
2869 let local_var_content = local_var_resp.text().await?;
2870
2871 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2872 crate::from_str_patched(&local_var_content).map_err(Error::from)
2873 } else {
2874 let local_var_entity: Option<GetWorkspaceNameError> = crate::from_str_patched(&local_var_content).ok();
2875 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2876 Err(Error::ResponseError(local_var_error))
2877 }
2878}
2879
2880pub async fn get_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetWorkspaceSlackOauthConfig200Response, Error<GetWorkspaceSlackOauthConfigError>> {
2881 let local_var_configuration = configuration;
2882
2883 let local_var_client = &local_var_configuration.client;
2884
2885 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2886 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2887
2888 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2889 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2890 }
2891 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2892 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2893 };
2894
2895 let local_var_req = local_var_req_builder.build()?;
2896 let local_var_resp = local_var_client.execute(local_var_req).await?;
2897
2898 let local_var_status = local_var_resp.status();
2899 let local_var_content = local_var_resp.text().await?;
2900
2901 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2902 crate::from_str_patched(&local_var_content).map_err(Error::from)
2903 } else {
2904 let local_var_entity: Option<GetWorkspaceSlackOauthConfigError> = crate::from_str_patched(&local_var_content).ok();
2905 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2906 Err(Error::ResponseError(local_var_error))
2907 }
2908}
2909
2910pub async fn get_workspace_usage(configuration: &configuration::Configuration, workspace: &str) -> Result<f64, Error<GetWorkspaceUsageError>> {
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/usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2916 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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
2925 let local_var_req = local_var_req_builder.build()?;
2926 let local_var_resp = local_var_client.execute(local_var_req).await?;
2927
2928 let local_var_status = local_var_resp.status();
2929 let local_var_content = local_var_resp.text().await?;
2930
2931 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2932 crate::from_str_patched(&local_var_content).map_err(Error::from)
2933 } else {
2934 let local_var_entity: Option<GetWorkspaceUsageError> = crate::from_str_patched(&local_var_content).ok();
2935 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2936 Err(Error::ResponseError(local_var_error))
2937 }
2938}
2939
2940pub async fn import_pg_database(configuration: &configuration::Configuration, workspace: &str, import_pg_database_request: models::ImportPgDatabaseRequest) -> Result<String, Error<ImportPgDatabaseError>> {
2941 let local_var_configuration = configuration;
2942
2943 let local_var_client = &local_var_configuration.client;
2944
2945 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/import_pg_database", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2946 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2947
2948 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2949 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2950 }
2951 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2952 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2953 };
2954 local_var_req_builder = local_var_req_builder.json(&import_pg_database_request);
2955
2956 let local_var_req = local_var_req_builder.build()?;
2957 let local_var_resp = local_var_client.execute(local_var_req).await?;
2958
2959 let local_var_status = local_var_resp.status();
2960 let local_var_content = local_var_resp.text().await?;
2961
2962 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2963 crate::from_str_patched(&local_var_content).map_err(Error::from)
2964 } else {
2965 let local_var_entity: Option<ImportPgDatabaseError> = crate::from_str_patched(&local_var_content).ok();
2966 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2967 Err(Error::ResponseError(local_var_error))
2968 }
2969}
2970
2971pub async fn invite_user(configuration: &configuration::Configuration, workspace: &str, invite_user_request: models::InviteUserRequest) -> Result<String, Error<InviteUserError>> {
2972 let local_var_configuration = configuration;
2973
2974 let local_var_client = &local_var_configuration.client;
2975
2976 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/invite_user", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2977 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2978
2979 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2980 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2981 }
2982 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2983 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2984 };
2985 local_var_req_builder = local_var_req_builder.json(&invite_user_request);
2986
2987 let local_var_req = local_var_req_builder.build()?;
2988 let local_var_resp = local_var_client.execute(local_var_req).await?;
2989
2990 let local_var_status = local_var_resp.status();
2991 let local_var_content = local_var_resp.text().await?;
2992
2993 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2994 crate::from_str_patched(&local_var_content).map_err(Error::from)
2995 } else {
2996 let local_var_entity: Option<InviteUserError> = crate::from_str_patched(&local_var_content).ok();
2997 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2998 Err(Error::ResponseError(local_var_error))
2999 }
3000}
3001
3002pub async fn is_domain_allowed(configuration: &configuration::Configuration, ) -> Result<bool, Error<IsDomainAllowedError>> {
3003 let local_var_configuration = configuration;
3004
3005 let local_var_client = &local_var_configuration.client;
3006
3007 let local_var_uri_str = format!("{}/workspaces/allowed_domain_auto_invite", local_var_configuration.base_path);
3008 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3009
3010 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3011 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3012 }
3013 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3014 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3015 };
3016
3017 let local_var_req = local_var_req_builder.build()?;
3018 let local_var_resp = local_var_client.execute(local_var_req).await?;
3019
3020 let local_var_status = local_var_resp.status();
3021 let local_var_content = local_var_resp.text().await?;
3022
3023 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3024 crate::from_str_patched(&local_var_content).map_err(Error::from)
3025 } else {
3026 let local_var_entity: Option<IsDomainAllowedError> = crate::from_str_patched(&local_var_content).ok();
3027 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3028 Err(Error::ResponseError(local_var_error))
3029 }
3030}
3031
3032pub async fn leave_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<LeaveWorkspaceError>> {
3033 let local_var_configuration = configuration;
3034
3035 let local_var_client = &local_var_configuration.client;
3036
3037 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/leave", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3038 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3039
3040 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3041 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3042 }
3043 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3044 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3045 };
3046
3047 let local_var_req = local_var_req_builder.build()?;
3048 let local_var_resp = local_var_client.execute(local_var_req).await?;
3049
3050 let local_var_status = local_var_resp.status();
3051 let local_var_content = local_var_resp.text().await?;
3052
3053 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3054 crate::from_str_patched(&local_var_content).map_err(Error::from)
3055 } else {
3056 let local_var_entity: Option<LeaveWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
3057 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3058 Err(Error::ResponseError(local_var_error))
3059 }
3060}
3061
3062pub async fn list_available_teams_channels(configuration: &configuration::Configuration, workspace: &str, team_id: &str) -> Result<models::ListAvailableTeamsChannels200Response, Error<ListAvailableTeamsChannelsError>> {
3063 let local_var_configuration = configuration;
3064
3065 let local_var_client = &local_var_configuration.client;
3066
3067 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_channels", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3068 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3069
3070 local_var_req_builder = local_var_req_builder.query(&[("team_id", &team_id.to_string())]);
3071 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3072 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3073 }
3074 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3075 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3076 };
3077
3078 let local_var_req = local_var_req_builder.build()?;
3079 let local_var_resp = local_var_client.execute(local_var_req).await?;
3080
3081 let local_var_status = local_var_resp.status();
3082 let local_var_content = local_var_resp.text().await?;
3083
3084 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3085 crate::from_str_patched(&local_var_content).map_err(Error::from)
3086 } else {
3087 let local_var_entity: Option<ListAvailableTeamsChannelsError> = crate::from_str_patched(&local_var_content).ok();
3088 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3089 Err(Error::ResponseError(local_var_error))
3090 }
3091}
3092
3093pub async fn list_available_teams_ids(configuration: &configuration::Configuration, workspace: &str, search: Option<&str>, next_link: Option<&str>) -> Result<models::ListAvailableTeamsIds200Response, Error<ListAvailableTeamsIdsError>> {
3094 let local_var_configuration = configuration;
3095
3096 let local_var_client = &local_var_configuration.client;
3097
3098 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/available_teams_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3099 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3100
3101 if let Some(ref local_var_str) = search {
3102 local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
3103 }
3104 if let Some(ref local_var_str) = next_link {
3105 local_var_req_builder = local_var_req_builder.query(&[("next_link", &local_var_str.to_string())]);
3106 }
3107 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3108 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3109 }
3110 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3111 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3112 };
3113
3114 let local_var_req = local_var_req_builder.build()?;
3115 let local_var_resp = local_var_client.execute(local_var_req).await?;
3116
3117 let local_var_status = local_var_resp.status();
3118 let local_var_content = local_var_resp.text().await?;
3119
3120 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3121 crate::from_str_patched(&local_var_content).map_err(Error::from)
3122 } else {
3123 let local_var_entity: Option<ListAvailableTeamsIdsError> = crate::from_str_patched(&local_var_content).ok();
3124 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3125 Err(Error::ResponseError(local_var_error))
3126 }
3127}
3128
3129pub async fn list_data_table_schemas(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableSchema>, Error<ListDataTableSchemasError>> {
3130 let local_var_configuration = configuration;
3131
3132 let local_var_client = &local_var_configuration.client;
3133
3134 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_schemas", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3135 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3136
3137 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3138 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3139 }
3140 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3141 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3142 };
3143
3144 let local_var_req = local_var_req_builder.build()?;
3145 let local_var_resp = local_var_client.execute(local_var_req).await?;
3146
3147 let local_var_status = local_var_resp.status();
3148 let local_var_content = local_var_resp.text().await?;
3149
3150 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3151 crate::from_str_patched(&local_var_content).map_err(Error::from)
3152 } else {
3153 let local_var_entity: Option<ListDataTableSchemasError> = crate::from_str_patched(&local_var_content).ok();
3154 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3155 Err(Error::ResponseError(local_var_error))
3156 }
3157}
3158
3159pub async fn list_data_table_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DataTableTables>, Error<ListDataTableTablesError>> {
3160 let local_var_configuration = configuration;
3161
3162 let local_var_client = &local_var_configuration.client;
3163
3164 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatable_tables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3165 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3166
3167 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3168 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3169 }
3170 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3171 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3172 };
3173
3174 let local_var_req = local_var_req_builder.build()?;
3175 let local_var_resp = local_var_client.execute(local_var_req).await?;
3176
3177 let local_var_status = local_var_resp.status();
3178 let local_var_content = local_var_resp.text().await?;
3179
3180 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3181 crate::from_str_patched(&local_var_content).map_err(Error::from)
3182 } else {
3183 let local_var_entity: Option<ListDataTableTablesError> = crate::from_str_patched(&local_var_content).ok();
3184 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3185 Err(Error::ResponseError(local_var_error))
3186 }
3187}
3188
3189pub async fn list_data_tables(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListDataTables200ResponseInner>, Error<ListDataTablesError>> {
3190 let local_var_configuration = configuration;
3191
3192 let local_var_client = &local_var_configuration.client;
3193
3194 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_datatables", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3195 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3196
3197 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3198 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3199 }
3200 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3201 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3202 };
3203
3204 let local_var_req = local_var_req_builder.build()?;
3205 let local_var_resp = local_var_client.execute(local_var_req).await?;
3206
3207 let local_var_status = local_var_resp.status();
3208 let local_var_content = local_var_resp.text().await?;
3209
3210 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3211 crate::from_str_patched(&local_var_content).map_err(Error::from)
3212 } else {
3213 let local_var_entity: Option<ListDataTablesError> = crate::from_str_patched(&local_var_content).ok();
3214 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3215 Err(Error::ResponseError(local_var_error))
3216 }
3217}
3218
3219pub async fn list_deployment_request_eligible_deployers(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::DeploymentRequestEligibleDeployer>, Error<ListDeploymentRequestEligibleDeployersError>> {
3221 let local_var_configuration = configuration;
3222
3223 let local_var_client = &local_var_configuration.client;
3224
3225 let local_var_uri_str = format!("{}/w/{workspace}/deployment_request/eligible_deployers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3226 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3227
3228 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3229 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3230 }
3231 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3232 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3233 };
3234
3235 let local_var_req = local_var_req_builder.build()?;
3236 let local_var_resp = local_var_client.execute(local_var_req).await?;
3237
3238 let local_var_status = local_var_resp.status();
3239 let local_var_content = local_var_resp.text().await?;
3240
3241 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3242 crate::from_str_patched(&local_var_content).map_err(Error::from)
3243 } else {
3244 let local_var_entity: Option<ListDeploymentRequestEligibleDeployersError> = crate::from_str_patched(&local_var_content).ok();
3245 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3246 Err(Error::ResponseError(local_var_error))
3247 }
3248}
3249
3250pub async fn list_ducklakes(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListDucklakesError>> {
3251 let local_var_configuration = configuration;
3252
3253 let local_var_client = &local_var_configuration.client;
3254
3255 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ducklakes", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3256 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3257
3258 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3259 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3260 }
3261 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3262 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3263 };
3264
3265 let local_var_req = local_var_req_builder.build()?;
3266 let local_var_resp = local_var_client.execute(local_var_req).await?;
3267
3268 let local_var_status = local_var_resp.status();
3269 let local_var_content = local_var_resp.text().await?;
3270
3271 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3272 crate::from_str_patched(&local_var_content).map_err(Error::from)
3273 } else {
3274 let local_var_entity: Option<ListDucklakesError> = crate::from_str_patched(&local_var_content).ok();
3275 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3276 Err(Error::ResponseError(local_var_error))
3277 }
3278}
3279
3280pub async fn list_pending_invites(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::WorkspaceInvite>, Error<ListPendingInvitesError>> {
3281 let local_var_configuration = configuration;
3282
3283 let local_var_client = &local_var_configuration.client;
3284
3285 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_pending_invites", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3286 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3287
3288 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3289 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3290 }
3291 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3292 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3293 };
3294
3295 let local_var_req = local_var_req_builder.build()?;
3296 let local_var_resp = local_var_client.execute(local_var_req).await?;
3297
3298 let local_var_status = local_var_resp.status();
3299 let local_var_content = local_var_resp.text().await?;
3300
3301 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3302 crate::from_str_patched(&local_var_content).map_err(Error::from)
3303 } else {
3304 let local_var_entity: Option<ListPendingInvitesError> = crate::from_str_patched(&local_var_content).ok();
3305 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3306 Err(Error::ResponseError(local_var_error))
3307 }
3308}
3309
3310pub async fn list_protection_rules(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ProtectionRuleset>, Error<ListProtectionRulesError>> {
3311 let local_var_configuration = configuration;
3312
3313 let local_var_client = &local_var_configuration.client;
3314
3315 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/protection_rules", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3316 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3317
3318 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3319 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3320 }
3321 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3322 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3323 };
3324
3325 let local_var_req = local_var_req_builder.build()?;
3326 let local_var_resp = local_var_client.execute(local_var_req).await?;
3327
3328 let local_var_status = local_var_resp.status();
3329 let local_var_content = local_var_resp.text().await?;
3330
3331 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3332 crate::from_str_patched(&local_var_content).map_err(Error::from)
3333 } else {
3334 let local_var_entity: Option<ListProtectionRulesError> = crate::from_str_patched(&local_var_content).ok();
3335 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3336 Err(Error::ResponseError(local_var_error))
3337 }
3338}
3339
3340pub async fn list_shared_ui(configuration: &configuration::Configuration, workspace: &str) -> Result<models::ListSharedUi200Response, Error<ListSharedUiError>> {
3341 let local_var_configuration = configuration;
3342
3343 let local_var_client = &local_var_configuration.client;
3344
3345 let local_var_uri_str = format!("{}/w/{workspace}/shared_ui/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3346 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3347
3348 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3349 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3350 }
3351 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3352 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3353 };
3354
3355 let local_var_req = local_var_req_builder.build()?;
3356 let local_var_resp = local_var_client.execute(local_var_req).await?;
3357
3358 let local_var_status = local_var_resp.status();
3359 let local_var_content = local_var_resp.text().await?;
3360
3361 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3362 crate::from_str_patched(&local_var_content).map_err(Error::from)
3363 } else {
3364 let local_var_entity: Option<ListSharedUiError> = crate::from_str_patched(&local_var_content).ok();
3365 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3366 Err(Error::ResponseError(local_var_error))
3367 }
3368}
3369
3370pub async fn list_user_workspaces(configuration: &configuration::Configuration, ) -> Result<models::UserWorkspaceList, Error<ListUserWorkspacesError>> {
3371 let local_var_configuration = configuration;
3372
3373 let local_var_client = &local_var_configuration.client;
3374
3375 let local_var_uri_str = format!("{}/workspaces/users", local_var_configuration.base_path);
3376 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3377
3378 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3379 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3380 }
3381 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3382 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3383 };
3384
3385 let local_var_req = local_var_req_builder.build()?;
3386 let local_var_resp = local_var_client.execute(local_var_req).await?;
3387
3388 let local_var_status = local_var_resp.status();
3389 let local_var_content = local_var_resp.text().await?;
3390
3391 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3392 crate::from_str_patched(&local_var_content).map_err(Error::from)
3393 } else {
3394 let local_var_entity: Option<ListUserWorkspacesError> = crate::from_str_patched(&local_var_content).ok();
3395 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3396 Err(Error::ResponseError(local_var_error))
3397 }
3398}
3399
3400pub async fn list_workspaces(configuration: &configuration::Configuration, ) -> Result<Vec<models::Workspace>, Error<ListWorkspacesError>> {
3401 let local_var_configuration = configuration;
3402
3403 let local_var_client = &local_var_configuration.client;
3404
3405 let local_var_uri_str = format!("{}/workspaces/list", local_var_configuration.base_path);
3406 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3407
3408 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3409 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3410 }
3411 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3412 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3413 };
3414
3415 let local_var_req = local_var_req_builder.build()?;
3416 let local_var_resp = local_var_client.execute(local_var_req).await?;
3417
3418 let local_var_status = local_var_resp.status();
3419 let local_var_content = local_var_resp.text().await?;
3420
3421 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3422 crate::from_str_patched(&local_var_content).map_err(Error::from)
3423 } else {
3424 let local_var_entity: Option<ListWorkspacesError> = crate::from_str_patched(&local_var_content).ok();
3425 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3426 Err(Error::ResponseError(local_var_error))
3427 }
3428}
3429
3430pub async fn list_workspaces_as_super_admin(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Workspace>, Error<ListWorkspacesAsSuperAdminError>> {
3431 let local_var_configuration = configuration;
3432
3433 let local_var_client = &local_var_configuration.client;
3434
3435 let local_var_uri_str = format!("{}/workspaces/list_as_superadmin", local_var_configuration.base_path);
3436 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3437
3438 if let Some(ref local_var_str) = page {
3439 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3440 }
3441 if let Some(ref local_var_str) = per_page {
3442 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3443 }
3444 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3445 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3446 }
3447 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3448 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3449 };
3450
3451 let local_var_req = local_var_req_builder.build()?;
3452 let local_var_resp = local_var_client.execute(local_var_req).await?;
3453
3454 let local_var_status = local_var_resp.status();
3455 let local_var_content = local_var_resp.text().await?;
3456
3457 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3458 crate::from_str_patched(&local_var_content).map_err(Error::from)
3459 } else {
3460 let local_var_entity: Option<ListWorkspacesAsSuperAdminError> = crate::from_str_patched(&local_var_content).ok();
3461 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3462 Err(Error::ResponseError(local_var_error))
3463 }
3464}
3465
3466pub async fn list_ws_specific(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListWsSpecific200ResponseInner>, Error<ListWsSpecificError>> {
3467 let local_var_configuration = configuration;
3468
3469 let local_var_client = &local_var_configuration.client;
3470
3471 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3472 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3473
3474 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3475 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3476 }
3477 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3478 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3479 };
3480
3481 let local_var_req = local_var_req_builder.build()?;
3482 let local_var_resp = local_var_client.execute(local_var_req).await?;
3483
3484 let local_var_status = local_var_resp.status();
3485 let local_var_content = local_var_resp.text().await?;
3486
3487 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3488 crate::from_str_patched(&local_var_content).map_err(Error::from)
3489 } else {
3490 let local_var_entity: Option<ListWsSpecificError> = crate::from_str_patched(&local_var_content).ok();
3491 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3492 Err(Error::ResponseError(local_var_error))
3493 }
3494}
3495
3496pub async fn list_ws_specific_versions(configuration: &configuration::Configuration, workspace: &str, kind: &str, path: &str) -> Result<Vec<String>, Error<ListWsSpecificVersionsError>> {
3497 let local_var_configuration = configuration;
3498
3499 let local_var_client = &local_var_configuration.client;
3500
3501 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/list_ws_specific_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3502 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3503
3504 local_var_req_builder = local_var_req_builder.query(&[("kind", &kind.to_string())]);
3505 local_var_req_builder = local_var_req_builder.query(&[("path", &path.to_string())]);
3506 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3507 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3508 }
3509 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3510 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3511 };
3512
3513 let local_var_req = local_var_req_builder.build()?;
3514 let local_var_resp = local_var_client.execute(local_var_req).await?;
3515
3516 let local_var_status = local_var_resp.status();
3517 let local_var_content = local_var_resp.text().await?;
3518
3519 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3520 crate::from_str_patched(&local_var_content).map_err(Error::from)
3521 } else {
3522 let local_var_entity: Option<ListWsSpecificVersionsError> = crate::from_str_patched(&local_var_content).ok();
3523 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3524 Err(Error::ResponseError(local_var_error))
3525 }
3526}
3527
3528pub async fn log_ai_chat(configuration: &configuration::Configuration, workspace: &str, log_ai_chat_request: models::LogAiChatRequest) -> Result<(), Error<LogAiChatError>> {
3529 let local_var_configuration = configuration;
3530
3531 let local_var_client = &local_var_configuration.client;
3532
3533 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/log_chat", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3534 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3535
3536 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3537 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3538 }
3539 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3540 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3541 };
3542 local_var_req_builder = local_var_req_builder.json(&log_ai_chat_request);
3543
3544 let local_var_req = local_var_req_builder.build()?;
3545 let local_var_resp = local_var_client.execute(local_var_req).await?;
3546
3547 let local_var_status = local_var_resp.status();
3548 let local_var_content = local_var_resp.text().await?;
3549
3550 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3551 Ok(())
3552 } else {
3553 let local_var_entity: Option<LogAiChatError> = crate::from_str_patched(&local_var_content).ok();
3554 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3555 Err(Error::ResponseError(local_var_error))
3556 }
3557}
3558
3559pub async fn prune_versions(configuration: &configuration::Configuration, workspace: &str, prune_versions_request: models::PruneVersionsRequest) -> Result<models::PruneVersions200Response, Error<PruneVersionsError>> {
3560 let local_var_configuration = configuration;
3561
3562 let local_var_client = &local_var_configuration.client;
3563
3564 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/prune_versions", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3565 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3566
3567 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3568 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3569 }
3570 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3571 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3572 };
3573 local_var_req_builder = local_var_req_builder.json(&prune_versions_request);
3574
3575 let local_var_req = local_var_req_builder.build()?;
3576 let local_var_resp = local_var_client.execute(local_var_req).await?;
3577
3578 let local_var_status = local_var_resp.status();
3579 let local_var_content = local_var_resp.text().await?;
3580
3581 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3582 crate::from_str_patched(&local_var_content).map_err(Error::from)
3583 } else {
3584 let local_var_entity: Option<PruneVersionsError> = crate::from_str_patched(&local_var_content).ok();
3585 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3586 Err(Error::ResponseError(local_var_error))
3587 }
3588}
3589
3590pub async fn rebuild_dependency_map(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<RebuildDependencyMapError>> {
3591 let local_var_configuration = configuration;
3592
3593 let local_var_client = &local_var_configuration.client;
3594
3595 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/rebuild_dependency_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3596 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3597
3598 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3599 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3600 }
3601 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3602 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3603 };
3604
3605 let local_var_req = local_var_req_builder.build()?;
3606 let local_var_resp = local_var_client.execute(local_var_req).await?;
3607
3608 let local_var_status = local_var_resp.status();
3609 let local_var_content = local_var_resp.text().await?;
3610
3611 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3612 crate::from_str_patched(&local_var_content).map_err(Error::from)
3613 } else {
3614 let local_var_entity: Option<RebuildDependencyMapError> = crate::from_str_patched(&local_var_content).ok();
3615 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3616 Err(Error::ResponseError(local_var_error))
3617 }
3618}
3619
3620pub async fn reset_diff_tally(configuration: &configuration::Configuration, workspace: &str, fork_workspace_id: &str) -> Result<serde_json::Value, Error<ResetDiffTallyError>> {
3622 let local_var_configuration = configuration;
3623
3624 let local_var_client = &local_var_configuration.client;
3625
3626 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));
3627 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3628
3629 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3630 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3631 }
3632 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3633 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3634 };
3635
3636 let local_var_req = local_var_req_builder.build()?;
3637 let local_var_resp = local_var_client.execute(local_var_req).await?;
3638
3639 let local_var_status = local_var_resp.status();
3640 let local_var_content = local_var_resp.text().await?;
3641
3642 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3643 crate::from_str_patched(&local_var_content).map_err(Error::from)
3644 } else {
3645 let local_var_entity: Option<ResetDiffTallyError> = crate::from_str_patched(&local_var_content).ok();
3646 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3647 Err(Error::ResponseError(local_var_error))
3648 }
3649}
3650
3651pub 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>> {
3652 let local_var_configuration = configuration;
3653
3654 let local_var_client = &local_var_configuration.client;
3655
3656 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_slack_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3657 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3658
3659 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3660 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3661 }
3662 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3663 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3664 };
3665 local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
3666
3667 let local_var_req = local_var_req_builder.build()?;
3668 let local_var_resp = local_var_client.execute(local_var_req).await?;
3669
3670 let local_var_status = local_var_resp.status();
3671 let local_var_content = local_var_resp.text().await?;
3672
3673 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3674 crate::from_str_patched(&local_var_content).map_err(Error::from)
3675 } else {
3676 let local_var_entity: Option<RunSlackMessageTestJobError> = crate::from_str_patched(&local_var_content).ok();
3677 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3678 Err(Error::ResponseError(local_var_error))
3679 }
3680}
3681
3682pub 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>> {
3683 let local_var_configuration = configuration;
3684
3685 let local_var_client = &local_var_configuration.client;
3686
3687 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/run_teams_message_test_job", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3688 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3689
3690 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3691 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3692 }
3693 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3694 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3695 };
3696 local_var_req_builder = local_var_req_builder.json(&run_slack_message_test_job_request);
3697
3698 let local_var_req = local_var_req_builder.build()?;
3699 let local_var_resp = local_var_client.execute(local_var_req).await?;
3700
3701 let local_var_status = local_var_resp.status();
3702 let local_var_content = local_var_resp.text().await?;
3703
3704 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3705 crate::from_str_patched(&local_var_content).map_err(Error::from)
3706 } else {
3707 let local_var_entity: Option<RunTeamsMessageTestJobError> = crate::from_str_patched(&local_var_content).ok();
3708 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3709 Err(Error::ResponseError(local_var_error))
3710 }
3711}
3712
3713pub async fn set_environment_variable(configuration: &configuration::Configuration, workspace: &str, set_environment_variable_request: models::SetEnvironmentVariableRequest) -> Result<String, Error<SetEnvironmentVariableError>> {
3714 let local_var_configuration = configuration;
3715
3716 let local_var_client = &local_var_configuration.client;
3717
3718 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/set_environment_variable", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3719 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3720
3721 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3722 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3723 }
3724 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3725 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3726 };
3727 local_var_req_builder = local_var_req_builder.json(&set_environment_variable_request);
3728
3729 let local_var_req = local_var_req_builder.build()?;
3730 let local_var_resp = local_var_client.execute(local_var_req).await?;
3731
3732 let local_var_status = local_var_resp.status();
3733 let local_var_content = local_var_resp.text().await?;
3734
3735 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3736 crate::from_str_patched(&local_var_content).map_err(Error::from)
3737 } else {
3738 let local_var_entity: Option<SetEnvironmentVariableError> = crate::from_str_patched(&local_var_content).ok();
3739 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3740 Err(Error::ResponseError(local_var_error))
3741 }
3742}
3743
3744pub async fn set_threshold_alert(configuration: &configuration::Configuration, workspace: &str, set_threshold_alert_request: models::SetThresholdAlertRequest) -> Result<String, Error<SetThresholdAlertError>> {
3745 let local_var_configuration = configuration;
3746
3747 let local_var_client = &local_var_configuration.client;
3748
3749 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/threshold_alert", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3750 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3751
3752 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3753 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3754 }
3755 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3756 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3757 };
3758 local_var_req_builder = local_var_req_builder.json(&set_threshold_alert_request);
3759
3760 let local_var_req = local_var_req_builder.build()?;
3761 let local_var_resp = local_var_client.execute(local_var_req).await?;
3762
3763 let local_var_status = local_var_resp.status();
3764 let local_var_content = local_var_resp.text().await?;
3765
3766 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3767 crate::from_str_patched(&local_var_content).map_err(Error::from)
3768 } else {
3769 let local_var_entity: Option<SetThresholdAlertError> = crate::from_str_patched(&local_var_content).ok();
3770 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3771 Err(Error::ResponseError(local_var_error))
3772 }
3773}
3774
3775pub async fn set_workspace_encryption_key(configuration: &configuration::Configuration, workspace: &str, set_workspace_encryption_key_request: models::SetWorkspaceEncryptionKeyRequest) -> Result<String, Error<SetWorkspaceEncryptionKeyError>> {
3776 let local_var_configuration = configuration;
3777
3778 let local_var_client = &local_var_configuration.client;
3779
3780 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/encryption_key", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3781 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3782
3783 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3784 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3785 }
3786 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3787 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3788 };
3789 local_var_req_builder = local_var_req_builder.json(&set_workspace_encryption_key_request);
3790
3791 let local_var_req = local_var_req_builder.build()?;
3792 let local_var_resp = local_var_client.execute(local_var_req).await?;
3793
3794 let local_var_status = local_var_resp.status();
3795 let local_var_content = local_var_resp.text().await?;
3796
3797 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3798 crate::from_str_patched(&local_var_content).map_err(Error::from)
3799 } else {
3800 let local_var_entity: Option<SetWorkspaceEncryptionKeyError> = crate::from_str_patched(&local_var_content).ok();
3801 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3802 Err(Error::ResponseError(local_var_error))
3803 }
3804}
3805
3806pub async fn set_workspace_slack_oauth_config(configuration: &configuration::Configuration, workspace: &str, set_workspace_slack_oauth_config_request: models::SetWorkspaceSlackOauthConfigRequest) -> Result<String, Error<SetWorkspaceSlackOauthConfigError>> {
3807 let local_var_configuration = configuration;
3808
3809 let local_var_client = &local_var_configuration.client;
3810
3811 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/slack_oauth_config", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3812 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3813
3814 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3815 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3816 }
3817 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3818 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3819 };
3820 local_var_req_builder = local_var_req_builder.json(&set_workspace_slack_oauth_config_request);
3821
3822 let local_var_req = local_var_req_builder.build()?;
3823 let local_var_resp = local_var_client.execute(local_var_req).await?;
3824
3825 let local_var_status = local_var_resp.status();
3826 let local_var_content = local_var_resp.text().await?;
3827
3828 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3829 crate::from_str_patched(&local_var_content).map_err(Error::from)
3830 } else {
3831 let local_var_entity: Option<SetWorkspaceSlackOauthConfigError> = crate::from_str_patched(&local_var_content).ok();
3832 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3833 Err(Error::ResponseError(local_var_error))
3834 }
3835}
3836
3837pub async fn tarball_workspace(configuration: &configuration::Configuration, workspace: &str, archive_type: Option<&str>, plain_secret: Option<bool>, skip_variables: Option<bool>, skip_resources: Option<bool>, skip_resource_types: Option<bool>, skip_secrets: Option<bool>, include_schedules: Option<bool>, include_triggers: Option<bool>, include_dmn: Option<bool>, include_users: Option<bool>, include_groups: Option<bool>, include_settings: Option<bool>, include_key: Option<bool>, include_workspace_dependencies: Option<bool>, default_ts: Option<&str>, settings_version: Option<&str>) -> Result<std::path::PathBuf, Error<TarballWorkspaceError>> {
3839 let local_var_configuration = configuration;
3840
3841 let local_var_client = &local_var_configuration.client;
3842
3843 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/tarball", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3844 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3845
3846 if let Some(ref local_var_str) = archive_type {
3847 local_var_req_builder = local_var_req_builder.query(&[("archive_type", &local_var_str.to_string())]);
3848 }
3849 if let Some(ref local_var_str) = plain_secret {
3850 local_var_req_builder = local_var_req_builder.query(&[("plain_secret", &local_var_str.to_string())]);
3851 }
3852 if let Some(ref local_var_str) = skip_variables {
3853 local_var_req_builder = local_var_req_builder.query(&[("skip_variables", &local_var_str.to_string())]);
3854 }
3855 if let Some(ref local_var_str) = skip_resources {
3856 local_var_req_builder = local_var_req_builder.query(&[("skip_resources", &local_var_str.to_string())]);
3857 }
3858 if let Some(ref local_var_str) = skip_resource_types {
3859 local_var_req_builder = local_var_req_builder.query(&[("skip_resource_types", &local_var_str.to_string())]);
3860 }
3861 if let Some(ref local_var_str) = skip_secrets {
3862 local_var_req_builder = local_var_req_builder.query(&[("skip_secrets", &local_var_str.to_string())]);
3863 }
3864 if let Some(ref local_var_str) = include_schedules {
3865 local_var_req_builder = local_var_req_builder.query(&[("include_schedules", &local_var_str.to_string())]);
3866 }
3867 if let Some(ref local_var_str) = include_triggers {
3868 local_var_req_builder = local_var_req_builder.query(&[("include_triggers", &local_var_str.to_string())]);
3869 }
3870 if let Some(ref local_var_str) = include_dmn {
3871 local_var_req_builder = local_var_req_builder.query(&[("include_dmn", &local_var_str.to_string())]);
3872 }
3873 if let Some(ref local_var_str) = include_users {
3874 local_var_req_builder = local_var_req_builder.query(&[("include_users", &local_var_str.to_string())]);
3875 }
3876 if let Some(ref local_var_str) = include_groups {
3877 local_var_req_builder = local_var_req_builder.query(&[("include_groups", &local_var_str.to_string())]);
3878 }
3879 if let Some(ref local_var_str) = include_settings {
3880 local_var_req_builder = local_var_req_builder.query(&[("include_settings", &local_var_str.to_string())]);
3881 }
3882 if let Some(ref local_var_str) = include_key {
3883 local_var_req_builder = local_var_req_builder.query(&[("include_key", &local_var_str.to_string())]);
3884 }
3885 if let Some(ref local_var_str) = include_workspace_dependencies {
3886 local_var_req_builder = local_var_req_builder.query(&[("include_workspace_dependencies", &local_var_str.to_string())]);
3887 }
3888 if let Some(ref local_var_str) = default_ts {
3889 local_var_req_builder = local_var_req_builder.query(&[("default_ts", &local_var_str.to_string())]);
3890 }
3891 if let Some(ref local_var_str) = settings_version {
3892 local_var_req_builder = local_var_req_builder.query(&[("settings_version", &local_var_str.to_string())]);
3893 }
3894 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3895 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3896 }
3897 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3898 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3899 };
3900
3901 let local_var_req = local_var_req_builder.build()?;
3902 let local_var_resp = local_var_client.execute(local_var_req).await?;
3903
3904 let local_var_status = local_var_resp.status();
3905 let local_var_content = local_var_resp.text().await?;
3906
3907 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3908 crate::from_str_patched(&local_var_content).map_err(Error::from)
3909 } else {
3910 let local_var_entity: Option<TarballWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
3911 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3912 Err(Error::ResponseError(local_var_error))
3913 }
3914}
3915
3916pub async fn unarchive_workspace(configuration: &configuration::Configuration, workspace: &str) -> Result<String, Error<UnarchiveWorkspaceError>> {
3917 let local_var_configuration = configuration;
3918
3919 let local_var_client = &local_var_configuration.client;
3920
3921 let local_var_uri_str = format!("{}/workspaces/unarchive/{workspace}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3922 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3923
3924 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3925 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3926 }
3927 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3928 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3929 };
3930
3931 let local_var_req = local_var_req_builder.build()?;
3932 let local_var_resp = local_var_client.execute(local_var_req).await?;
3933
3934 let local_var_status = local_var_resp.status();
3935 let local_var_content = local_var_resp.text().await?;
3936
3937 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3938 crate::from_str_patched(&local_var_content).map_err(Error::from)
3939 } else {
3940 let local_var_entity: Option<UnarchiveWorkspaceError> = crate::from_str_patched(&local_var_content).ok();
3941 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3942 Err(Error::ResponseError(local_var_error))
3943 }
3944}
3945
3946pub async fn update_operator_settings(configuration: &configuration::Configuration, workspace: &str, operator_settings: Option<models::OperatorSettings>) -> Result<String, Error<UpdateOperatorSettingsError>> {
3948 let local_var_configuration = configuration;
3949
3950 let local_var_client = &local_var_configuration.client;
3951
3952 let local_var_uri_str = format!("{}/w/{workspace}/workspaces/operator_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3953 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3954
3955 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3956 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3957 }
3958 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3959 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3960 };
3961 local_var_req_builder = local_var_req_builder.json(&operator_settings);
3962
3963 let local_var_req = local_var_req_builder.build()?;
3964 let local_var_resp = local_var_client.execute(local_var_req).await?;
3965
3966 let local_var_status = local_var_resp.status();
3967 let local_var_content = local_var_resp.text().await?;
3968
3969 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3970 crate::from_str_patched(&local_var_content).map_err(Error::from)
3971 } else {
3972 let local_var_entity: Option<UpdateOperatorSettingsError> = crate::from_str_patched(&local_var_content).ok();
3973 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3974 Err(Error::ResponseError(local_var_error))
3975 }
3976}
3977
3978pub async fn update_protection_rule(configuration: &configuration::Configuration, workspace: &str, rule_name: &str, update_protection_rule_request: models::UpdateProtectionRuleRequest) -> Result<String, Error<UpdateProtectionRuleError>> {
3979 let local_var_configuration = configuration;
3980
3981 let local_var_client = &local_var_configuration.client;
3982
3983 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));
3984 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3985
3986 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3987 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3988 }
3989 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3990 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3991 };
3992 local_var_req_builder = local_var_req_builder.json(&update_protection_rule_request);
3993
3994 let local_var_req = local_var_req_builder.build()?;
3995 let local_var_resp = local_var_client.execute(local_var_req).await?;
3996
3997 let local_var_status = local_var_resp.status();
3998 let local_var_content = local_var_resp.text().await?;
3999
4000 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4001 crate::from_str_patched(&local_var_content).map_err(Error::from)
4002 } else {
4003 let local_var_entity: Option<UpdateProtectionRuleError> = crate::from_str_patched(&local_var_content).ok();
4004 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4005 Err(Error::ResponseError(local_var_error))
4006 }
4007}
4008
4009pub async fn update_shared_ui(configuration: &configuration::Configuration, workspace: &str, update_shared_ui_request: models::UpdateSharedUiRequest) -> Result<String, Error<UpdateSharedUiError>> {
4010 let local_var_configuration = configuration;
4011
4012 let local_var_client = &local_var_configuration.client;
4013
4014 let local_var_uri_str = format!("{}/w/{workspace}/shared_ui", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4015 let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
4016
4017 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4018 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4019 }
4020 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4021 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4022 };
4023 local_var_req_builder = local_var_req_builder.json(&update_shared_ui_request);
4024
4025 let local_var_req = local_var_req_builder.build()?;
4026 let local_var_resp = local_var_client.execute(local_var_req).await?;
4027
4028 let local_var_status = local_var_resp.status();
4029 let local_var_content = local_var_resp.text().await?;
4030
4031 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4032 crate::from_str_patched(&local_var_content).map_err(Error::from)
4033 } else {
4034 let local_var_entity: Option<UpdateSharedUiError> = crate::from_str_patched(&local_var_content).ok();
4035 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4036 Err(Error::ResponseError(local_var_error))
4037 }
4038}
4039