1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ActivityLogsListError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ActivityLogsRetrieveError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum AuditGetUserError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum AuthMeError {
43 Status400(serde_json::Value),
44 UnknownValue(serde_json::Value),
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
49#[serde(untagged)]
50pub enum AuthOidcError {
51 UnknownValue(serde_json::Value),
52}
53
54#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(untagged)]
57pub enum AuthRevokeError {
58 UnknownValue(serde_json::Value),
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum ChangeRequestPoliciesCreateError {
65 UnknownValue(serde_json::Value),
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize)]
70#[serde(untagged)]
71pub enum ChangeRequestPoliciesDeleteError {
72 UnknownValue(serde_json::Value),
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
77#[serde(untagged)]
78pub enum ChangeRequestPoliciesGetError {
79 UnknownValue(serde_json::Value),
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum ChangeRequestPoliciesListError {
86 Status400(serde_json::Value),
87 UnknownValue(serde_json::Value),
88}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum ChangeRequestPoliciesUpdateError {
94 UnknownValue(serde_json::Value),
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum ConfigLogsGetError {
101 UnknownValue(serde_json::Value),
102}
103
104#[derive(Debug, Clone, Serialize, Deserialize)]
106#[serde(untagged)]
107pub enum ConfigLogsListError {
108 UnknownValue(serde_json::Value),
109}
110
111#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(untagged)]
114pub enum ConfigLogsRollbackError {
115 UnknownValue(serde_json::Value),
116}
117
118#[derive(Debug, Clone, Serialize, Deserialize)]
120#[serde(untagged)]
121pub enum ConfigsAddTrustedIpError {
122 UnknownValue(serde_json::Value),
123}
124
125#[derive(Debug, Clone, Serialize, Deserialize)]
127#[serde(untagged)]
128pub enum ConfigsCloneError {
129 UnknownValue(serde_json::Value),
130}
131
132#[derive(Debug, Clone, Serialize, Deserialize)]
134#[serde(untagged)]
135pub enum ConfigsCreateError {
136 UnknownValue(serde_json::Value),
137}
138
139#[derive(Debug, Clone, Serialize, Deserialize)]
141#[serde(untagged)]
142pub enum ConfigsDeleteError {
143 UnknownValue(serde_json::Value),
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum ConfigsDeleteTrustedIpError {
150 Status404(),
151 UnknownValue(serde_json::Value),
152}
153
154#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum ConfigsGetError {
158 UnknownValue(serde_json::Value),
159}
160
161#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(untagged)]
164pub enum ConfigsInheritableError {
165 UnknownValue(serde_json::Value),
166}
167
168#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum ConfigsInheritsError {
172 UnknownValue(serde_json::Value),
173}
174
175#[derive(Debug, Clone, Serialize, Deserialize)]
177#[serde(untagged)]
178pub enum ConfigsListError {
179 UnknownValue(serde_json::Value),
180}
181
182#[derive(Debug, Clone, Serialize, Deserialize)]
184#[serde(untagged)]
185pub enum ConfigsListTrustedIpsError {
186 UnknownValue(serde_json::Value),
187}
188
189#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum ConfigsLockError {
193 UnknownValue(serde_json::Value),
194}
195
196#[derive(Debug, Clone, Serialize, Deserialize)]
198#[serde(untagged)]
199pub enum ConfigsUnlockError {
200 UnknownValue(serde_json::Value),
201}
202
203#[derive(Debug, Clone, Serialize, Deserialize)]
205#[serde(untagged)]
206pub enum ConfigsUpdateError {
207 UnknownValue(serde_json::Value),
208}
209
210#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum DynamicSecretsIssueLeaseError {
214 UnknownValue(serde_json::Value),
215}
216
217#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(untagged)]
220pub enum DynamicSecretsRevokeLeaseError {
221 UnknownValue(serde_json::Value),
222}
223
224#[derive(Debug, Clone, Serialize, Deserialize)]
226#[serde(untagged)]
227pub enum EnvironmentsCreateError {
228 UnknownValue(serde_json::Value),
229}
230
231#[derive(Debug, Clone, Serialize, Deserialize)]
233#[serde(untagged)]
234pub enum EnvironmentsDeleteError {
235 UnknownValue(serde_json::Value),
236}
237
238#[derive(Debug, Clone, Serialize, Deserialize)]
240#[serde(untagged)]
241pub enum EnvironmentsGetError {
242 UnknownValue(serde_json::Value),
243}
244
245#[derive(Debug, Clone, Serialize, Deserialize)]
247#[serde(untagged)]
248pub enum EnvironmentsListError {
249 UnknownValue(serde_json::Value),
250}
251
252#[derive(Debug, Clone, Serialize, Deserialize)]
254#[serde(untagged)]
255pub enum EnvironmentsRenameError {
256 UnknownValue(serde_json::Value),
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum GetOptionsError {
263 Status400(serde_json::Value),
264 UnknownValue(serde_json::Value),
265}
266
267#[derive(Debug, Clone, Serialize, Deserialize)]
269#[serde(untagged)]
270pub enum GroupsAddMemberError {
271 Status409(),
272 UnknownValue(serde_json::Value),
273}
274
275#[derive(Debug, Clone, Serialize, Deserialize)]
277#[serde(untagged)]
278pub enum GroupsCreateError {
279 Status404(),
280 UnknownValue(serde_json::Value),
281}
282
283#[derive(Debug, Clone, Serialize, Deserialize)]
285#[serde(untagged)]
286pub enum GroupsDeleteError {
287 UnknownValue(serde_json::Value),
288}
289
290#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum GroupsDeleteMemberError {
294 UnknownValue(serde_json::Value),
295}
296
297#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum GroupsGetError {
301 Status404(),
302 UnknownValue(serde_json::Value),
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum GroupsListError {
309 UnknownValue(serde_json::Value),
310}
311
312#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum GroupsUpdateError {
316 Status404(),
317 UnknownValue(serde_json::Value),
318}
319
320#[derive(Debug, Clone, Serialize, Deserialize)]
322#[serde(untagged)]
323pub enum IntegrationsCreateError {
324 Status400(serde_json::Value),
325 UnknownValue(serde_json::Value),
326}
327
328#[derive(Debug, Clone, Serialize, Deserialize)]
330#[serde(untagged)]
331pub enum IntegrationsDeleteError {
332 Status400(serde_json::Value),
333 UnknownValue(serde_json::Value),
334}
335
336#[derive(Debug, Clone, Serialize, Deserialize)]
338#[serde(untagged)]
339pub enum IntegrationsGetError {
340 Status400(serde_json::Value),
341 UnknownValue(serde_json::Value),
342}
343
344#[derive(Debug, Clone, Serialize, Deserialize)]
346#[serde(untagged)]
347pub enum IntegrationsListError {
348 UnknownValue(serde_json::Value),
349}
350
351#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(untagged)]
354pub enum IntegrationsUpdateError {
355 Status400(serde_json::Value),
356 UnknownValue(serde_json::Value),
357}
358
359#[derive(Debug, Clone, Serialize, Deserialize)]
361#[serde(untagged)]
362pub enum InvitesListError {
363 UnknownValue(serde_json::Value),
364}
365
366#[derive(Debug, Clone, Serialize, Deserialize)]
368#[serde(untagged)]
369pub enum ProjectMembersAddError {
370 UnknownValue(serde_json::Value),
371}
372
373#[derive(Debug, Clone, Serialize, Deserialize)]
375#[serde(untagged)]
376pub enum ProjectMembersDeleteError {
377 UnknownValue(serde_json::Value),
378}
379
380#[derive(Debug, Clone, Serialize, Deserialize)]
382#[serde(untagged)]
383pub enum ProjectMembersGetError {
384 UnknownValue(serde_json::Value),
385}
386
387#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum ProjectMembersListError {
391 UnknownValue(serde_json::Value),
392}
393
394#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum ProjectMembersUpdateError {
398 UnknownValue(serde_json::Value),
399}
400
401#[derive(Debug, Clone, Serialize, Deserialize)]
403#[serde(untagged)]
404pub enum ProjectRolesCreateError {
405 UnknownValue(serde_json::Value),
406}
407
408#[derive(Debug, Clone, Serialize, Deserialize)]
410#[serde(untagged)]
411pub enum ProjectRolesDeleteError {
412 Status404(serde_json::Value),
413 UnknownValue(serde_json::Value),
414}
415
416#[derive(Debug, Clone, Serialize, Deserialize)]
418#[serde(untagged)]
419pub enum ProjectRolesGetError {
420 Status404(),
421 UnknownValue(serde_json::Value),
422}
423
424#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum ProjectRolesListError {
428 UnknownValue(serde_json::Value),
429}
430
431#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum ProjectRolesListPermissionsError {
435 UnknownValue(serde_json::Value),
436}
437
438#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum ProjectRolesUpdateError {
442 Status404(serde_json::Value),
443 UnknownValue(serde_json::Value),
444}
445
446#[derive(Debug, Clone, Serialize, Deserialize)]
448#[serde(untagged)]
449pub enum ProjectsCreateError {
450 UnknownValue(serde_json::Value),
451}
452
453#[derive(Debug, Clone, Serialize, Deserialize)]
455#[serde(untagged)]
456pub enum ProjectsDeleteError {
457 UnknownValue(serde_json::Value),
458}
459
460#[derive(Debug, Clone, Serialize, Deserialize)]
462#[serde(untagged)]
463pub enum ProjectsGetError {
464 UnknownValue(serde_json::Value),
465}
466
467#[derive(Debug, Clone, Serialize, Deserialize)]
469#[serde(untagged)]
470pub enum ProjectsListError {
471 UnknownValue(serde_json::Value),
472}
473
474#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum ProjectsUpdateError {
478 UnknownValue(serde_json::Value),
479}
480
481#[derive(Debug, Clone, Serialize, Deserialize)]
483#[serde(untagged)]
484pub enum RetrieveMemberError {
485 Status404(),
486 UnknownValue(serde_json::Value),
487}
488
489#[derive(Debug, Clone, Serialize, Deserialize)]
491#[serde(untagged)]
492pub enum SecretsDeleteError {
493 UnknownValue(serde_json::Value),
494}
495
496#[derive(Debug, Clone, Serialize, Deserialize)]
498#[serde(untagged)]
499pub enum SecretsDownloadError {
500 UnknownValue(serde_json::Value),
501}
502
503#[derive(Debug, Clone, Serialize, Deserialize)]
505#[serde(untagged)]
506pub enum SecretsGetError {
507 UnknownValue(serde_json::Value),
508}
509
510#[derive(Debug, Clone, Serialize, Deserialize)]
512#[serde(untagged)]
513pub enum SecretsListError {
514 UnknownValue(serde_json::Value),
515}
516
517#[derive(Debug, Clone, Serialize, Deserialize)]
519#[serde(untagged)]
520pub enum SecretsNamesError {
521 UnknownValue(serde_json::Value),
522}
523
524#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum SecretsUpdateError {
528 UnknownValue(serde_json::Value),
529}
530
531#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum SecretsUpdateNoteError {
535 UnknownValue(serde_json::Value),
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum ServiceAccountTokensCreateError {
542 UnknownValue(serde_json::Value),
543}
544
545#[derive(Debug, Clone, Serialize, Deserialize)]
547#[serde(untagged)]
548pub enum ServiceAccountTokensDeleteError {
549 Status404(models::ServiceAccountTokenNotFoundResponse),
550 UnknownValue(serde_json::Value),
551}
552
553#[derive(Debug, Clone, Serialize, Deserialize)]
555#[serde(untagged)]
556pub enum ServiceAccountTokensGetError {
557 Status404(models::ServiceAccountTokenNotFoundResponse),
558 UnknownValue(serde_json::Value),
559}
560
561#[derive(Debug, Clone, Serialize, Deserialize)]
563#[serde(untagged)]
564pub enum ServiceAccountTokensListError {
565 UnknownValue(serde_json::Value),
566}
567
568#[derive(Debug, Clone, Serialize, Deserialize)]
570#[serde(untagged)]
571pub enum ServiceAccountsCreateError {
572 UnknownValue(serde_json::Value),
573}
574
575#[derive(Debug, Clone, Serialize, Deserialize)]
577#[serde(untagged)]
578pub enum ServiceAccountsDeleteError {
579 Status404(),
580 UnknownValue(serde_json::Value),
581}
582
583#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum ServiceAccountsGetError {
587 Status404(),
588 UnknownValue(serde_json::Value),
589}
590
591#[derive(Debug, Clone, Serialize, Deserialize)]
593#[serde(untagged)]
594pub enum ServiceAccountsListError {
595 UnknownValue(serde_json::Value),
596}
597
598#[derive(Debug, Clone, Serialize, Deserialize)]
600#[serde(untagged)]
601pub enum ServiceAccountsUpdateError {
602 Status404(),
603 UnknownValue(serde_json::Value),
604}
605
606#[derive(Debug, Clone, Serialize, Deserialize)]
608#[serde(untagged)]
609pub enum ServiceTokensCreateError {
610 UnknownValue(serde_json::Value),
611}
612
613#[derive(Debug, Clone, Serialize, Deserialize)]
615#[serde(untagged)]
616pub enum ServiceTokensDeleteError {
617 UnknownValue(serde_json::Value),
618}
619
620#[derive(Debug, Clone, Serialize, Deserialize)]
622#[serde(untagged)]
623pub enum ServiceTokensListError {
624 UnknownValue(serde_json::Value),
625}
626
627#[derive(Debug, Clone, Serialize, Deserialize)]
629#[serde(untagged)]
630pub enum SyncsCreateError {
631 Status400(serde_json::Value),
632 UnknownValue(serde_json::Value),
633}
634
635#[derive(Debug, Clone, Serialize, Deserialize)]
637#[serde(untagged)]
638pub enum SyncsDeleteError {
639 Status400(serde_json::Value),
640 UnknownValue(serde_json::Value),
641}
642
643#[derive(Debug, Clone, Serialize, Deserialize)]
645#[serde(untagged)]
646pub enum SyncsGetError {
647 Status400(serde_json::Value),
648 UnknownValue(serde_json::Value),
649}
650
651#[derive(Debug, Clone, Serialize, Deserialize)]
653#[serde(untagged)]
654pub enum UsersGetError {
655 UnknownValue(serde_json::Value),
656}
657
658#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum UsersListError {
662 UnknownValue(serde_json::Value),
663}
664
665#[derive(Debug, Clone, Serialize, Deserialize)]
667#[serde(untagged)]
668pub enum UsersUpdateError {
669 UnknownValue(serde_json::Value),
670}
671
672#[derive(Debug, Clone, Serialize, Deserialize)]
674#[serde(untagged)]
675pub enum WebhooksAddError {
676 Status400(serde_json::Value),
677 UnknownValue(serde_json::Value),
678}
679
680#[derive(Debug, Clone, Serialize, Deserialize)]
682#[serde(untagged)]
683pub enum WebhooksDeleteError {
684 Status400(serde_json::Value),
685 UnknownValue(serde_json::Value),
686}
687
688#[derive(Debug, Clone, Serialize, Deserialize)]
690#[serde(untagged)]
691pub enum WebhooksDisableError {
692 Status400(serde_json::Value),
693 UnknownValue(serde_json::Value),
694}
695
696#[derive(Debug, Clone, Serialize, Deserialize)]
698#[serde(untagged)]
699pub enum WebhooksEnableError {
700 Status400(serde_json::Value),
701 UnknownValue(serde_json::Value),
702}
703
704#[derive(Debug, Clone, Serialize, Deserialize)]
706#[serde(untagged)]
707pub enum WebhooksGetError {
708 Status400(serde_json::Value),
709 UnknownValue(serde_json::Value),
710}
711
712#[derive(Debug, Clone, Serialize, Deserialize)]
714#[serde(untagged)]
715pub enum WebhooksListError {
716 Status400(serde_json::Value),
717 UnknownValue(serde_json::Value),
718}
719
720#[derive(Debug, Clone, Serialize, Deserialize)]
722#[serde(untagged)]
723pub enum WebhooksUpdateError {
724 Status400(serde_json::Value),
725 UnknownValue(serde_json::Value),
726}
727
728#[derive(Debug, Clone, Serialize, Deserialize)]
730#[serde(untagged)]
731pub enum WorkplaceGetError {
732 UnknownValue(serde_json::Value),
733}
734
735#[derive(Debug, Clone, Serialize, Deserialize)]
737#[serde(untagged)]
738pub enum WorkplaceRolesCreateError {
739 UnknownValue(serde_json::Value),
740}
741
742#[derive(Debug, Clone, Serialize, Deserialize)]
744#[serde(untagged)]
745pub enum WorkplaceRolesDeleteError {
746 Status404(serde_json::Value),
747 UnknownValue(serde_json::Value),
748}
749
750#[derive(Debug, Clone, Serialize, Deserialize)]
752#[serde(untagged)]
753pub enum WorkplaceRolesGetError {
754 Status404(),
755 UnknownValue(serde_json::Value),
756}
757
758#[derive(Debug, Clone, Serialize, Deserialize)]
760#[serde(untagged)]
761pub enum WorkplaceRolesListError {
762 UnknownValue(serde_json::Value),
763}
764
765#[derive(Debug, Clone, Serialize, Deserialize)]
767#[serde(untagged)]
768pub enum WorkplaceRolesListPermissionsError {
769 UnknownValue(serde_json::Value),
770}
771
772#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum WorkplaceRolesUpdateError {
776 Status404(serde_json::Value),
777 UnknownValue(serde_json::Value),
778}
779
780#[derive(Debug, Clone, Serialize, Deserialize)]
782#[serde(untagged)]
783pub enum WorkplaceUpdateError {
784 UnknownValue(serde_json::Value),
785}
786
787
788pub async fn activity_logs_list(configuration: &configuration::Configuration, page: Option<&str>, per_page: Option<i32>) -> Result<models::ActivityLogsListResponse, Error<ActivityLogsListError>> {
790 let p_page = page;
792 let p_per_page = per_page;
793
794 let uri_str = format!("{}/v3/logs", configuration.base_path);
795 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
796
797 if let Some(ref param_value) = p_page {
798 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
799 }
800 if let Some(ref param_value) = p_per_page {
801 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
802 }
803 if let Some(ref user_agent) = configuration.user_agent {
804 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
805 }
806 if let Some(ref token) = configuration.bearer_access_token {
807 req_builder = req_builder.bearer_auth(token.to_owned());
808 };
809
810 let req = req_builder.build()?;
811 let resp = configuration.client.execute(req).await?;
812
813 let status = resp.status();
814 let content_type = resp
815 .headers()
816 .get("content-type")
817 .and_then(|v| v.to_str().ok())
818 .unwrap_or("application/octet-stream");
819 let content_type = super::ContentType::from(content_type);
820
821 if !status.is_client_error() && !status.is_server_error() {
822 let content = resp.text().await?;
823 match content_type {
824 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
825 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityLogsListResponse`"))),
826 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityLogsListResponse`")))),
827 }
828 } else {
829 let content = resp.text().await?;
830 let entity: Option<ActivityLogsListError> = serde_json::from_str(&content).ok();
831 Err(Error::ResponseError(ResponseContent { status, content, entity }))
832 }
833}
834
835pub async fn activity_logs_retrieve(configuration: &configuration::Configuration, log: &str) -> Result<models::ActivityLogGetResponse, Error<ActivityLogsRetrieveError>> {
837 let p_log = log;
839
840 let uri_str = format!("{}/v3/logs/log", configuration.base_path);
841 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
842
843 req_builder = req_builder.query(&[("log", &p_log.to_string())]);
844 if let Some(ref user_agent) = configuration.user_agent {
845 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
846 }
847 if let Some(ref token) = configuration.bearer_access_token {
848 req_builder = req_builder.bearer_auth(token.to_owned());
849 };
850
851 let req = req_builder.build()?;
852 let resp = configuration.client.execute(req).await?;
853
854 let status = resp.status();
855 let content_type = resp
856 .headers()
857 .get("content-type")
858 .and_then(|v| v.to_str().ok())
859 .unwrap_or("application/octet-stream");
860 let content_type = super::ContentType::from(content_type);
861
862 if !status.is_client_error() && !status.is_server_error() {
863 let content = resp.text().await?;
864 match content_type {
865 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
866 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityLogGetResponse`"))),
867 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityLogGetResponse`")))),
868 }
869 } else {
870 let content = resp.text().await?;
871 let entity: Option<ActivityLogsRetrieveError> = serde_json::from_str(&content).ok();
872 Err(Error::ResponseError(ResponseContent { status, content, entity }))
873 }
874}
875
876pub async fn audit_get_user(configuration: &configuration::Configuration, workplace_user_id: &str, settings: Option<bool>) -> Result<models::AuditUserGetResponse, Error<AuditGetUserError>> {
878 let p_workplace_user_id = workplace_user_id;
880 let p_settings = settings;
881
882 let uri_str = format!("{}/v3/workplace/users/{workplace_user_id}", configuration.base_path, workplace_user_id=crate::apis::urlencode(p_workplace_user_id));
883 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
884
885 if let Some(ref param_value) = p_settings {
886 req_builder = req_builder.query(&[("settings", ¶m_value.to_string())]);
887 }
888 if let Some(ref user_agent) = configuration.user_agent {
889 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
890 }
891 if let Some(ref token) = configuration.bearer_access_token {
892 req_builder = req_builder.bearer_auth(token.to_owned());
893 };
894
895 let req = req_builder.build()?;
896 let resp = configuration.client.execute(req).await?;
897
898 let status = resp.status();
899 let content_type = resp
900 .headers()
901 .get("content-type")
902 .and_then(|v| v.to_str().ok())
903 .unwrap_or("application/octet-stream");
904 let content_type = super::ContentType::from(content_type);
905
906 if !status.is_client_error() && !status.is_server_error() {
907 let content = resp.text().await?;
908 match content_type {
909 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
910 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuditUserGetResponse`"))),
911 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuditUserGetResponse`")))),
912 }
913 } else {
914 let content = resp.text().await?;
915 let entity: Option<AuditGetUserError> = serde_json::from_str(&content).ok();
916 Err(Error::ResponseError(ResponseContent { status, content, entity }))
917 }
918}
919
920pub async fn auth_me(configuration: &configuration::Configuration, ) -> Result<models::AuthMeResponse, Error<AuthMeError>> {
922
923 let uri_str = format!("{}/v3/me", configuration.base_path);
924 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
925
926 if let Some(ref user_agent) = configuration.user_agent {
927 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
928 }
929 if let Some(ref token) = configuration.bearer_access_token {
930 req_builder = req_builder.bearer_auth(token.to_owned());
931 };
932
933 let req = req_builder.build()?;
934 let resp = configuration.client.execute(req).await?;
935
936 let status = resp.status();
937 let content_type = resp
938 .headers()
939 .get("content-type")
940 .and_then(|v| v.to_str().ok())
941 .unwrap_or("application/octet-stream");
942 let content_type = super::ContentType::from(content_type);
943
944 if !status.is_client_error() && !status.is_server_error() {
945 let content = resp.text().await?;
946 match content_type {
947 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
948 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthMeResponse`"))),
949 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthMeResponse`")))),
950 }
951 } else {
952 let content = resp.text().await?;
953 let entity: Option<AuthMeError> = serde_json::from_str(&content).ok();
954 Err(Error::ResponseError(ResponseContent { status, content, entity }))
955 }
956}
957
958pub async fn auth_oidc(configuration: &configuration::Configuration, oidc_auth_request: Option<models::OidcAuthRequest>) -> Result<models::OidcAuthResponse, Error<AuthOidcError>> {
960 let p_oidc_auth_request = oidc_auth_request;
962
963 let uri_str = format!("{}/v3/auth/oidc", configuration.base_path);
964 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
965
966 if let Some(ref user_agent) = configuration.user_agent {
967 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
968 }
969 req_builder = req_builder.json(&p_oidc_auth_request);
970
971 let req = req_builder.build()?;
972 let resp = configuration.client.execute(req).await?;
973
974 let status = resp.status();
975 let content_type = resp
976 .headers()
977 .get("content-type")
978 .and_then(|v| v.to_str().ok())
979 .unwrap_or("application/octet-stream");
980 let content_type = super::ContentType::from(content_type);
981
982 if !status.is_client_error() && !status.is_server_error() {
983 let content = resp.text().await?;
984 match content_type {
985 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
986 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OidcAuthResponse`"))),
987 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OidcAuthResponse`")))),
988 }
989 } else {
990 let content = resp.text().await?;
991 let entity: Option<AuthOidcError> = serde_json::from_str(&content).ok();
992 Err(Error::ResponseError(ResponseContent { status, content, entity }))
993 }
994}
995
996pub async fn auth_revoke(configuration: &configuration::Configuration, revoke_auth_request: Option<models::RevokeAuthRequest>) -> Result<(), Error<AuthRevokeError>> {
998 let p_revoke_auth_request = revoke_auth_request;
1000
1001 let uri_str = format!("{}/v3/auth/revoke", configuration.base_path);
1002 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1003
1004 if let Some(ref user_agent) = configuration.user_agent {
1005 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1006 }
1007 req_builder = req_builder.json(&p_revoke_auth_request);
1008
1009 let req = req_builder.build()?;
1010 let resp = configuration.client.execute(req).await?;
1011
1012 let status = resp.status();
1013
1014 if !status.is_client_error() && !status.is_server_error() {
1015 Ok(())
1016 } else {
1017 let content = resp.text().await?;
1018 let entity: Option<AuthRevokeError> = serde_json::from_str(&content).ok();
1019 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1020 }
1021}
1022
1023pub async fn change_request_policies_create(configuration: &configuration::Configuration, update_change_request_policy_request: Option<models::UpdateChangeRequestPolicyRequest>) -> Result<models::ChangeRequestPolicyUpdateResponse, Error<ChangeRequestPoliciesCreateError>> {
1025 let p_update_change_request_policy_request = update_change_request_policy_request;
1027
1028 let uri_str = format!("{}/v3/workplace/change_request_policies", configuration.base_path);
1029 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1030
1031 if let Some(ref user_agent) = configuration.user_agent {
1032 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1033 }
1034 if let Some(ref token) = configuration.bearer_access_token {
1035 req_builder = req_builder.bearer_auth(token.to_owned());
1036 };
1037 req_builder = req_builder.json(&p_update_change_request_policy_request);
1038
1039 let req = req_builder.build()?;
1040 let resp = configuration.client.execute(req).await?;
1041
1042 let status = resp.status();
1043 let content_type = resp
1044 .headers()
1045 .get("content-type")
1046 .and_then(|v| v.to_str().ok())
1047 .unwrap_or("application/octet-stream");
1048 let content_type = super::ContentType::from(content_type);
1049
1050 if !status.is_client_error() && !status.is_server_error() {
1051 let content = resp.text().await?;
1052 match content_type {
1053 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1054 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeRequestPolicyUpdateResponse`"))),
1055 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangeRequestPolicyUpdateResponse`")))),
1056 }
1057 } else {
1058 let content = resp.text().await?;
1059 let entity: Option<ChangeRequestPoliciesCreateError> = serde_json::from_str(&content).ok();
1060 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1061 }
1062}
1063
1064pub async fn change_request_policies_delete(configuration: &configuration::Configuration, slug: &str) -> Result<models::ConfigDeleteResponse, Error<ChangeRequestPoliciesDeleteError>> {
1066 let p_slug = slug;
1068
1069 let uri_str = format!("{}/v3/workplace/change_request_policies/change_request_policy/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1070 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1071
1072 if let Some(ref user_agent) = configuration.user_agent {
1073 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1074 }
1075 if let Some(ref token) = configuration.bearer_access_token {
1076 req_builder = req_builder.bearer_auth(token.to_owned());
1077 };
1078
1079 let req = req_builder.build()?;
1080 let resp = configuration.client.execute(req).await?;
1081
1082 let status = resp.status();
1083 let content_type = resp
1084 .headers()
1085 .get("content-type")
1086 .and_then(|v| v.to_str().ok())
1087 .unwrap_or("application/octet-stream");
1088 let content_type = super::ContentType::from(content_type);
1089
1090 if !status.is_client_error() && !status.is_server_error() {
1091 let content = resp.text().await?;
1092 match content_type {
1093 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1094 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigDeleteResponse`"))),
1095 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigDeleteResponse`")))),
1096 }
1097 } else {
1098 let content = resp.text().await?;
1099 let entity: Option<ChangeRequestPoliciesDeleteError> = serde_json::from_str(&content).ok();
1100 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1101 }
1102}
1103
1104pub async fn change_request_policies_get(configuration: &configuration::Configuration, slug: &str) -> Result<models::ChangeRequestPolicyGetResponse, Error<ChangeRequestPoliciesGetError>> {
1106 let p_slug = slug;
1108
1109 let uri_str = format!("{}/v3/workplace/change_request_policies/change_request_policy/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1110 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1111
1112 if let Some(ref user_agent) = configuration.user_agent {
1113 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1114 }
1115 if let Some(ref token) = configuration.bearer_access_token {
1116 req_builder = req_builder.bearer_auth(token.to_owned());
1117 };
1118
1119 let req = req_builder.build()?;
1120 let resp = configuration.client.execute(req).await?;
1121
1122 let status = resp.status();
1123 let content_type = resp
1124 .headers()
1125 .get("content-type")
1126 .and_then(|v| v.to_str().ok())
1127 .unwrap_or("application/octet-stream");
1128 let content_type = super::ContentType::from(content_type);
1129
1130 if !status.is_client_error() && !status.is_server_error() {
1131 let content = resp.text().await?;
1132 match content_type {
1133 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1134 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeRequestPolicyGetResponse`"))),
1135 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangeRequestPolicyGetResponse`")))),
1136 }
1137 } else {
1138 let content = resp.text().await?;
1139 let entity: Option<ChangeRequestPoliciesGetError> = serde_json::from_str(&content).ok();
1140 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1141 }
1142}
1143
1144pub async fn change_request_policies_list(configuration: &configuration::Configuration, ) -> Result<models::ChangeRequestPoliciesListResponse, Error<ChangeRequestPoliciesListError>> {
1146
1147 let uri_str = format!("{}/v3/workplace/change_request_policies", configuration.base_path);
1148 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1149
1150 if let Some(ref user_agent) = configuration.user_agent {
1151 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1152 }
1153 if let Some(ref token) = configuration.bearer_access_token {
1154 req_builder = req_builder.bearer_auth(token.to_owned());
1155 };
1156
1157 let req = req_builder.build()?;
1158 let resp = configuration.client.execute(req).await?;
1159
1160 let status = resp.status();
1161 let content_type = resp
1162 .headers()
1163 .get("content-type")
1164 .and_then(|v| v.to_str().ok())
1165 .unwrap_or("application/octet-stream");
1166 let content_type = super::ContentType::from(content_type);
1167
1168 if !status.is_client_error() && !status.is_server_error() {
1169 let content = resp.text().await?;
1170 match content_type {
1171 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1172 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeRequestPoliciesListResponse`"))),
1173 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangeRequestPoliciesListResponse`")))),
1174 }
1175 } else {
1176 let content = resp.text().await?;
1177 let entity: Option<ChangeRequestPoliciesListError> = serde_json::from_str(&content).ok();
1178 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1179 }
1180}
1181
1182pub async fn change_request_policies_update(configuration: &configuration::Configuration, slug: &str, update_change_request_policy_request: Option<models::UpdateChangeRequestPolicyRequest>) -> Result<models::ChangeRequestPolicyUpdateResponse, Error<ChangeRequestPoliciesUpdateError>> {
1184 let p_slug = slug;
1186 let p_update_change_request_policy_request = update_change_request_policy_request;
1187
1188 let uri_str = format!("{}/v3/workplace/change_request_policies/change_request_policy/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1189 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1190
1191 if let Some(ref user_agent) = configuration.user_agent {
1192 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1193 }
1194 if let Some(ref token) = configuration.bearer_access_token {
1195 req_builder = req_builder.bearer_auth(token.to_owned());
1196 };
1197 req_builder = req_builder.json(&p_update_change_request_policy_request);
1198
1199 let req = req_builder.build()?;
1200 let resp = configuration.client.execute(req).await?;
1201
1202 let status = resp.status();
1203 let content_type = resp
1204 .headers()
1205 .get("content-type")
1206 .and_then(|v| v.to_str().ok())
1207 .unwrap_or("application/octet-stream");
1208 let content_type = super::ContentType::from(content_type);
1209
1210 if !status.is_client_error() && !status.is_server_error() {
1211 let content = resp.text().await?;
1212 match content_type {
1213 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1214 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeRequestPolicyUpdateResponse`"))),
1215 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangeRequestPolicyUpdateResponse`")))),
1216 }
1217 } else {
1218 let content = resp.text().await?;
1219 let entity: Option<ChangeRequestPoliciesUpdateError> = serde_json::from_str(&content).ok();
1220 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1221 }
1222}
1223
1224pub async fn config_logs_get(configuration: &configuration::Configuration, project: &str, config: &str, log: &str) -> Result<models::ConfigLogGetResponse, Error<ConfigLogsGetError>> {
1226 let p_project = project;
1228 let p_config = config;
1229 let p_log = log;
1230
1231 let uri_str = format!("{}/v3/configs/config/logs/log", configuration.base_path);
1232 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1233
1234 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1235 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1236 req_builder = req_builder.query(&[("log", &p_log.to_string())]);
1237 if let Some(ref user_agent) = configuration.user_agent {
1238 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1239 }
1240 if let Some(ref token) = configuration.bearer_access_token {
1241 req_builder = req_builder.bearer_auth(token.to_owned());
1242 };
1243
1244 let req = req_builder.build()?;
1245 let resp = configuration.client.execute(req).await?;
1246
1247 let status = resp.status();
1248 let content_type = resp
1249 .headers()
1250 .get("content-type")
1251 .and_then(|v| v.to_str().ok())
1252 .unwrap_or("application/octet-stream");
1253 let content_type = super::ContentType::from(content_type);
1254
1255 if !status.is_client_error() && !status.is_server_error() {
1256 let content = resp.text().await?;
1257 match content_type {
1258 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1259 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigLogGetResponse`"))),
1260 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigLogGetResponse`")))),
1261 }
1262 } else {
1263 let content = resp.text().await?;
1264 let entity: Option<ConfigLogsGetError> = serde_json::from_str(&content).ok();
1265 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1266 }
1267}
1268
1269pub async fn config_logs_list(configuration: &configuration::Configuration, project: &str, config: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ConfigLogsListResponse, Error<ConfigLogsListError>> {
1271 let p_project = project;
1273 let p_config = config;
1274 let p_page = page;
1275 let p_per_page = per_page;
1276
1277 let uri_str = format!("{}/v3/configs/config/logs", configuration.base_path);
1278 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1279
1280 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1281 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1282 if let Some(ref param_value) = p_page {
1283 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1284 }
1285 if let Some(ref param_value) = p_per_page {
1286 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
1287 }
1288 if let Some(ref user_agent) = configuration.user_agent {
1289 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1290 }
1291 if let Some(ref token) = configuration.bearer_access_token {
1292 req_builder = req_builder.bearer_auth(token.to_owned());
1293 };
1294
1295 let req = req_builder.build()?;
1296 let resp = configuration.client.execute(req).await?;
1297
1298 let status = resp.status();
1299 let content_type = resp
1300 .headers()
1301 .get("content-type")
1302 .and_then(|v| v.to_str().ok())
1303 .unwrap_or("application/octet-stream");
1304 let content_type = super::ContentType::from(content_type);
1305
1306 if !status.is_client_error() && !status.is_server_error() {
1307 let content = resp.text().await?;
1308 match content_type {
1309 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1310 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigLogsListResponse`"))),
1311 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigLogsListResponse`")))),
1312 }
1313 } else {
1314 let content = resp.text().await?;
1315 let entity: Option<ConfigLogsListError> = serde_json::from_str(&content).ok();
1316 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1317 }
1318}
1319
1320pub async fn config_logs_rollback(configuration: &configuration::Configuration, project: &str, config: &str, log: &str) -> Result<models::ConfigLogRollbackResponse, Error<ConfigLogsRollbackError>> {
1322 let p_project = project;
1324 let p_config = config;
1325 let p_log = log;
1326
1327 let uri_str = format!("{}/v3/configs/config/logs/log/rollback", configuration.base_path);
1328 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1329
1330 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1331 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1332 req_builder = req_builder.query(&[("log", &p_log.to_string())]);
1333 if let Some(ref user_agent) = configuration.user_agent {
1334 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1335 }
1336 if let Some(ref token) = configuration.bearer_access_token {
1337 req_builder = req_builder.bearer_auth(token.to_owned());
1338 };
1339
1340 let req = req_builder.build()?;
1341 let resp = configuration.client.execute(req).await?;
1342
1343 let status = resp.status();
1344 let content_type = resp
1345 .headers()
1346 .get("content-type")
1347 .and_then(|v| v.to_str().ok())
1348 .unwrap_or("application/octet-stream");
1349 let content_type = super::ContentType::from(content_type);
1350
1351 if !status.is_client_error() && !status.is_server_error() {
1352 let content = resp.text().await?;
1353 match content_type {
1354 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1355 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigLogRollbackResponse`"))),
1356 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigLogRollbackResponse`")))),
1357 }
1358 } else {
1359 let content = resp.text().await?;
1360 let entity: Option<ConfigLogsRollbackError> = serde_json::from_str(&content).ok();
1361 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1362 }
1363}
1364
1365pub async fn configs_add_trusted_ip(configuration: &configuration::Configuration, project: &str, config: &str, add_trusted_ip_request: Option<models::AddTrustedIpRequest>) -> Result<models::TrustedIpAddResponse, Error<ConfigsAddTrustedIpError>> {
1367 let p_project = project;
1369 let p_config = config;
1370 let p_add_trusted_ip_request = add_trusted_ip_request;
1371
1372 let uri_str = format!("{}/v3/configs/config/trusted_ips", configuration.base_path);
1373 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1374
1375 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1376 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1377 if let Some(ref user_agent) = configuration.user_agent {
1378 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1379 }
1380 if let Some(ref token) = configuration.bearer_access_token {
1381 req_builder = req_builder.bearer_auth(token.to_owned());
1382 };
1383 req_builder = req_builder.json(&p_add_trusted_ip_request);
1384
1385 let req = req_builder.build()?;
1386 let resp = configuration.client.execute(req).await?;
1387
1388 let status = resp.status();
1389 let content_type = resp
1390 .headers()
1391 .get("content-type")
1392 .and_then(|v| v.to_str().ok())
1393 .unwrap_or("application/octet-stream");
1394 let content_type = super::ContentType::from(content_type);
1395
1396 if !status.is_client_error() && !status.is_server_error() {
1397 let content = resp.text().await?;
1398 match content_type {
1399 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1400 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustedIpAddResponse`"))),
1401 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TrustedIpAddResponse`")))),
1402 }
1403 } else {
1404 let content = resp.text().await?;
1405 let entity: Option<ConfigsAddTrustedIpError> = serde_json::from_str(&content).ok();
1406 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1407 }
1408}
1409
1410pub async fn configs_clone(configuration: &configuration::Configuration, clone_config_request: Option<models::CloneConfigRequest>) -> Result<models::ConfigGetResponse, Error<ConfigsCloneError>> {
1412 let p_clone_config_request = clone_config_request;
1414
1415 let uri_str = format!("{}/v3/configs/config/clone", configuration.base_path);
1416 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1417
1418 if let Some(ref user_agent) = configuration.user_agent {
1419 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1420 }
1421 if let Some(ref token) = configuration.bearer_access_token {
1422 req_builder = req_builder.bearer_auth(token.to_owned());
1423 };
1424 req_builder = req_builder.json(&p_clone_config_request);
1425
1426 let req = req_builder.build()?;
1427 let resp = configuration.client.execute(req).await?;
1428
1429 let status = resp.status();
1430 let content_type = resp
1431 .headers()
1432 .get("content-type")
1433 .and_then(|v| v.to_str().ok())
1434 .unwrap_or("application/octet-stream");
1435 let content_type = super::ContentType::from(content_type);
1436
1437 if !status.is_client_error() && !status.is_server_error() {
1438 let content = resp.text().await?;
1439 match content_type {
1440 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1441 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigGetResponse`"))),
1442 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigGetResponse`")))),
1443 }
1444 } else {
1445 let content = resp.text().await?;
1446 let entity: Option<ConfigsCloneError> = serde_json::from_str(&content).ok();
1447 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1448 }
1449}
1450
1451pub async fn configs_create(configuration: &configuration::Configuration, create_config_request: Option<models::CreateConfigRequest>) -> Result<models::ConfigGetResponse, Error<ConfigsCreateError>> {
1453 let p_create_config_request = create_config_request;
1455
1456 let uri_str = format!("{}/v3/configs", configuration.base_path);
1457 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1458
1459 if let Some(ref user_agent) = configuration.user_agent {
1460 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1461 }
1462 if let Some(ref token) = configuration.bearer_access_token {
1463 req_builder = req_builder.bearer_auth(token.to_owned());
1464 };
1465 req_builder = req_builder.json(&p_create_config_request);
1466
1467 let req = req_builder.build()?;
1468 let resp = configuration.client.execute(req).await?;
1469
1470 let status = resp.status();
1471 let content_type = resp
1472 .headers()
1473 .get("content-type")
1474 .and_then(|v| v.to_str().ok())
1475 .unwrap_or("application/octet-stream");
1476 let content_type = super::ContentType::from(content_type);
1477
1478 if !status.is_client_error() && !status.is_server_error() {
1479 let content = resp.text().await?;
1480 match content_type {
1481 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1482 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigGetResponse`"))),
1483 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigGetResponse`")))),
1484 }
1485 } else {
1486 let content = resp.text().await?;
1487 let entity: Option<ConfigsCreateError> = serde_json::from_str(&content).ok();
1488 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1489 }
1490}
1491
1492pub async fn configs_delete(configuration: &configuration::Configuration, project: &str, config: &str) -> Result<models::ConfigDeleteResponse, Error<ConfigsDeleteError>> {
1494 let p_project = project;
1496 let p_config = config;
1497
1498 let uri_str = format!("{}/v3/configs/config", configuration.base_path);
1499 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1500
1501 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1502 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1503 if let Some(ref user_agent) = configuration.user_agent {
1504 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1505 }
1506 if let Some(ref token) = configuration.bearer_access_token {
1507 req_builder = req_builder.bearer_auth(token.to_owned());
1508 };
1509
1510 let req = req_builder.build()?;
1511 let resp = configuration.client.execute(req).await?;
1512
1513 let status = resp.status();
1514 let content_type = resp
1515 .headers()
1516 .get("content-type")
1517 .and_then(|v| v.to_str().ok())
1518 .unwrap_or("application/octet-stream");
1519 let content_type = super::ContentType::from(content_type);
1520
1521 if !status.is_client_error() && !status.is_server_error() {
1522 let content = resp.text().await?;
1523 match content_type {
1524 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1525 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigDeleteResponse`"))),
1526 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigDeleteResponse`")))),
1527 }
1528 } else {
1529 let content = resp.text().await?;
1530 let entity: Option<ConfigsDeleteError> = serde_json::from_str(&content).ok();
1531 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1532 }
1533}
1534
1535pub async fn configs_delete_trusted_ip(configuration: &configuration::Configuration, project: &str, config: &str, add_trusted_ip_request: Option<models::AddTrustedIpRequest>) -> Result<(), Error<ConfigsDeleteTrustedIpError>> {
1537 let p_project = project;
1539 let p_config = config;
1540 let p_add_trusted_ip_request = add_trusted_ip_request;
1541
1542 let uri_str = format!("{}/v3/configs/config/trusted_ips", configuration.base_path);
1543 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1544
1545 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1546 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1547 if let Some(ref user_agent) = configuration.user_agent {
1548 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1549 }
1550 if let Some(ref token) = configuration.bearer_access_token {
1551 req_builder = req_builder.bearer_auth(token.to_owned());
1552 };
1553 req_builder = req_builder.json(&p_add_trusted_ip_request);
1554
1555 let req = req_builder.build()?;
1556 let resp = configuration.client.execute(req).await?;
1557
1558 let status = resp.status();
1559
1560 if !status.is_client_error() && !status.is_server_error() {
1561 Ok(())
1562 } else {
1563 let content = resp.text().await?;
1564 let entity: Option<ConfigsDeleteTrustedIpError> = serde_json::from_str(&content).ok();
1565 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1566 }
1567}
1568
1569pub async fn configs_get(configuration: &configuration::Configuration, project: &str, config: &str) -> Result<models::ConfigGetResponse, Error<ConfigsGetError>> {
1571 let p_project = project;
1573 let p_config = config;
1574
1575 let uri_str = format!("{}/v3/configs/config", configuration.base_path);
1576 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1577
1578 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1579 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1580 if let Some(ref user_agent) = configuration.user_agent {
1581 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1582 }
1583 if let Some(ref token) = configuration.bearer_access_token {
1584 req_builder = req_builder.bearer_auth(token.to_owned());
1585 };
1586
1587 let req = req_builder.build()?;
1588 let resp = configuration.client.execute(req).await?;
1589
1590 let status = resp.status();
1591 let content_type = resp
1592 .headers()
1593 .get("content-type")
1594 .and_then(|v| v.to_str().ok())
1595 .unwrap_or("application/octet-stream");
1596 let content_type = super::ContentType::from(content_type);
1597
1598 if !status.is_client_error() && !status.is_server_error() {
1599 let content = resp.text().await?;
1600 match content_type {
1601 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1602 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigGetResponse`"))),
1603 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigGetResponse`")))),
1604 }
1605 } else {
1606 let content = resp.text().await?;
1607 let entity: Option<ConfigsGetError> = serde_json::from_str(&content).ok();
1608 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1609 }
1610}
1611
1612pub async fn configs_inheritable(configuration: &configuration::Configuration, config_inheritable_request: Option<models::ConfigInheritableRequest>) -> Result<models::ConfigInheritableResponse, Error<ConfigsInheritableError>> {
1614 let p_config_inheritable_request = config_inheritable_request;
1616
1617 let uri_str = format!("{}/v3/configs/config/inheritable", configuration.base_path);
1618 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1619
1620 if let Some(ref user_agent) = configuration.user_agent {
1621 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1622 }
1623 if let Some(ref token) = configuration.bearer_access_token {
1624 req_builder = req_builder.bearer_auth(token.to_owned());
1625 };
1626 req_builder = req_builder.json(&p_config_inheritable_request);
1627
1628 let req = req_builder.build()?;
1629 let resp = configuration.client.execute(req).await?;
1630
1631 let status = resp.status();
1632 let content_type = resp
1633 .headers()
1634 .get("content-type")
1635 .and_then(|v| v.to_str().ok())
1636 .unwrap_or("application/octet-stream");
1637 let content_type = super::ContentType::from(content_type);
1638
1639 if !status.is_client_error() && !status.is_server_error() {
1640 let content = resp.text().await?;
1641 match content_type {
1642 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1643 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigInheritableResponse`"))),
1644 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigInheritableResponse`")))),
1645 }
1646 } else {
1647 let content = resp.text().await?;
1648 let entity: Option<ConfigsInheritableError> = serde_json::from_str(&content).ok();
1649 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1650 }
1651}
1652
1653pub async fn configs_inherits(configuration: &configuration::Configuration, config_inherits_request: Option<models::ConfigInheritsRequest>) -> Result<models::ConfigInheritsResponse, Error<ConfigsInheritsError>> {
1655 let p_config_inherits_request = config_inherits_request;
1657
1658 let uri_str = format!("{}/v3/configs/config/inherits", configuration.base_path);
1659 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1660
1661 if let Some(ref user_agent) = configuration.user_agent {
1662 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1663 }
1664 if let Some(ref token) = configuration.bearer_access_token {
1665 req_builder = req_builder.bearer_auth(token.to_owned());
1666 };
1667 req_builder = req_builder.json(&p_config_inherits_request);
1668
1669 let req = req_builder.build()?;
1670 let resp = configuration.client.execute(req).await?;
1671
1672 let status = resp.status();
1673 let content_type = resp
1674 .headers()
1675 .get("content-type")
1676 .and_then(|v| v.to_str().ok())
1677 .unwrap_or("application/octet-stream");
1678 let content_type = super::ContentType::from(content_type);
1679
1680 if !status.is_client_error() && !status.is_server_error() {
1681 let content = resp.text().await?;
1682 match content_type {
1683 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1684 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigInheritsResponse`"))),
1685 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigInheritsResponse`")))),
1686 }
1687 } else {
1688 let content = resp.text().await?;
1689 let entity: Option<ConfigsInheritsError> = serde_json::from_str(&content).ok();
1690 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1691 }
1692}
1693
1694pub async fn configs_list(configuration: &configuration::Configuration, project: &str, environment: Option<&str>, page: Option<i32>, per_page: Option<i32>) -> Result<models::ConfigsListResponse, Error<ConfigsListError>> {
1696 let p_project = project;
1698 let p_environment = environment;
1699 let p_page = page;
1700 let p_per_page = per_page;
1701
1702 let uri_str = format!("{}/v3/configs", configuration.base_path);
1703 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1704
1705 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1706 if let Some(ref param_value) = p_environment {
1707 req_builder = req_builder.query(&[("environment", ¶m_value.to_string())]);
1708 }
1709 if let Some(ref param_value) = p_page {
1710 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1711 }
1712 if let Some(ref param_value) = p_per_page {
1713 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
1714 }
1715 if let Some(ref user_agent) = configuration.user_agent {
1716 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1717 }
1718 if let Some(ref token) = configuration.bearer_access_token {
1719 req_builder = req_builder.bearer_auth(token.to_owned());
1720 };
1721
1722 let req = req_builder.build()?;
1723 let resp = configuration.client.execute(req).await?;
1724
1725 let status = resp.status();
1726 let content_type = resp
1727 .headers()
1728 .get("content-type")
1729 .and_then(|v| v.to_str().ok())
1730 .unwrap_or("application/octet-stream");
1731 let content_type = super::ContentType::from(content_type);
1732
1733 if !status.is_client_error() && !status.is_server_error() {
1734 let content = resp.text().await?;
1735 match content_type {
1736 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1737 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigsListResponse`"))),
1738 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigsListResponse`")))),
1739 }
1740 } else {
1741 let content = resp.text().await?;
1742 let entity: Option<ConfigsListError> = serde_json::from_str(&content).ok();
1743 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1744 }
1745}
1746
1747pub async fn configs_list_trusted_ips(configuration: &configuration::Configuration, project: &str, config: &str) -> Result<models::TrustedIpsListResponse, Error<ConfigsListTrustedIpsError>> {
1749 let p_project = project;
1751 let p_config = config;
1752
1753 let uri_str = format!("{}/v3/configs/config/trusted_ips", configuration.base_path);
1754 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1755
1756 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
1757 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
1758 if let Some(ref user_agent) = configuration.user_agent {
1759 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1760 }
1761 if let Some(ref token) = configuration.bearer_access_token {
1762 req_builder = req_builder.bearer_auth(token.to_owned());
1763 };
1764
1765 let req = req_builder.build()?;
1766 let resp = configuration.client.execute(req).await?;
1767
1768 let status = resp.status();
1769 let content_type = resp
1770 .headers()
1771 .get("content-type")
1772 .and_then(|v| v.to_str().ok())
1773 .unwrap_or("application/octet-stream");
1774 let content_type = super::ContentType::from(content_type);
1775
1776 if !status.is_client_error() && !status.is_server_error() {
1777 let content = resp.text().await?;
1778 match content_type {
1779 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1780 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrustedIpsListResponse`"))),
1781 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TrustedIpsListResponse`")))),
1782 }
1783 } else {
1784 let content = resp.text().await?;
1785 let entity: Option<ConfigsListTrustedIpsError> = serde_json::from_str(&content).ok();
1786 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1787 }
1788}
1789
1790pub async fn configs_lock(configuration: &configuration::Configuration, unlock_config_request: Option<models::UnlockConfigRequest>) -> Result<models::ConfigLockResponse, Error<ConfigsLockError>> {
1792 let p_unlock_config_request = unlock_config_request;
1794
1795 let uri_str = format!("{}/v3/configs/config/lock", configuration.base_path);
1796 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1797
1798 if let Some(ref user_agent) = configuration.user_agent {
1799 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1800 }
1801 if let Some(ref token) = configuration.bearer_access_token {
1802 req_builder = req_builder.bearer_auth(token.to_owned());
1803 };
1804 req_builder = req_builder.json(&p_unlock_config_request);
1805
1806 let req = req_builder.build()?;
1807 let resp = configuration.client.execute(req).await?;
1808
1809 let status = resp.status();
1810 let content_type = resp
1811 .headers()
1812 .get("content-type")
1813 .and_then(|v| v.to_str().ok())
1814 .unwrap_or("application/octet-stream");
1815 let content_type = super::ContentType::from(content_type);
1816
1817 if !status.is_client_error() && !status.is_server_error() {
1818 let content = resp.text().await?;
1819 match content_type {
1820 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1821 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigLockResponse`"))),
1822 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigLockResponse`")))),
1823 }
1824 } else {
1825 let content = resp.text().await?;
1826 let entity: Option<ConfigsLockError> = serde_json::from_str(&content).ok();
1827 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1828 }
1829}
1830
1831pub async fn configs_unlock(configuration: &configuration::Configuration, unlock_config_request: Option<models::UnlockConfigRequest>) -> Result<models::ConfigGetResponse, Error<ConfigsUnlockError>> {
1833 let p_unlock_config_request = unlock_config_request;
1835
1836 let uri_str = format!("{}/v3/configs/config/unlock", configuration.base_path);
1837 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1838
1839 if let Some(ref user_agent) = configuration.user_agent {
1840 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1841 }
1842 if let Some(ref token) = configuration.bearer_access_token {
1843 req_builder = req_builder.bearer_auth(token.to_owned());
1844 };
1845 req_builder = req_builder.json(&p_unlock_config_request);
1846
1847 let req = req_builder.build()?;
1848 let resp = configuration.client.execute(req).await?;
1849
1850 let status = resp.status();
1851 let content_type = resp
1852 .headers()
1853 .get("content-type")
1854 .and_then(|v| v.to_str().ok())
1855 .unwrap_or("application/octet-stream");
1856 let content_type = super::ContentType::from(content_type);
1857
1858 if !status.is_client_error() && !status.is_server_error() {
1859 let content = resp.text().await?;
1860 match content_type {
1861 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1862 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigGetResponse`"))),
1863 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigGetResponse`")))),
1864 }
1865 } else {
1866 let content = resp.text().await?;
1867 let entity: Option<ConfigsUnlockError> = serde_json::from_str(&content).ok();
1868 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1869 }
1870}
1871
1872pub async fn configs_update(configuration: &configuration::Configuration, update_config_request: Option<models::UpdateConfigRequest>) -> Result<models::ConfigUpdateResponse, Error<ConfigsUpdateError>> {
1874 let p_update_config_request = update_config_request;
1876
1877 let uri_str = format!("{}/v3/configs/config", configuration.base_path);
1878 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1879
1880 if let Some(ref user_agent) = configuration.user_agent {
1881 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1882 }
1883 if let Some(ref token) = configuration.bearer_access_token {
1884 req_builder = req_builder.bearer_auth(token.to_owned());
1885 };
1886 req_builder = req_builder.json(&p_update_config_request);
1887
1888 let req = req_builder.build()?;
1889 let resp = configuration.client.execute(req).await?;
1890
1891 let status = resp.status();
1892 let content_type = resp
1893 .headers()
1894 .get("content-type")
1895 .and_then(|v| v.to_str().ok())
1896 .unwrap_or("application/octet-stream");
1897 let content_type = super::ContentType::from(content_type);
1898
1899 if !status.is_client_error() && !status.is_server_error() {
1900 let content = resp.text().await?;
1901 match content_type {
1902 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1903 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigUpdateResponse`"))),
1904 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigUpdateResponse`")))),
1905 }
1906 } else {
1907 let content = resp.text().await?;
1908 let entity: Option<ConfigsUpdateError> = serde_json::from_str(&content).ok();
1909 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1910 }
1911}
1912
1913pub async fn dynamic_secrets_issue_lease(configuration: &configuration::Configuration, issue_dynamic_secret_lease_request: Option<models::IssueDynamicSecretLeaseRequest>) -> Result<models::DynamicSecretLeaseIssueResponse, Error<DynamicSecretsIssueLeaseError>> {
1915 let p_issue_dynamic_secret_lease_request = issue_dynamic_secret_lease_request;
1917
1918 let uri_str = format!("{}/v3/configs/config/dynamic_secrets/dynamic_secret/leases", configuration.base_path);
1919 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1920
1921 if let Some(ref user_agent) = configuration.user_agent {
1922 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1923 }
1924 if let Some(ref token) = configuration.bearer_access_token {
1925 req_builder = req_builder.bearer_auth(token.to_owned());
1926 };
1927 req_builder = req_builder.json(&p_issue_dynamic_secret_lease_request);
1928
1929 let req = req_builder.build()?;
1930 let resp = configuration.client.execute(req).await?;
1931
1932 let status = resp.status();
1933 let content_type = resp
1934 .headers()
1935 .get("content-type")
1936 .and_then(|v| v.to_str().ok())
1937 .unwrap_or("application/octet-stream");
1938 let content_type = super::ContentType::from(content_type);
1939
1940 if !status.is_client_error() && !status.is_server_error() {
1941 let content = resp.text().await?;
1942 match content_type {
1943 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1944 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DynamicSecretLeaseIssueResponse`"))),
1945 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DynamicSecretLeaseIssueResponse`")))),
1946 }
1947 } else {
1948 let content = resp.text().await?;
1949 let entity: Option<DynamicSecretsIssueLeaseError> = serde_json::from_str(&content).ok();
1950 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1951 }
1952}
1953
1954pub async fn dynamic_secrets_revoke_lease(configuration: &configuration::Configuration, revoke_dynamic_secret_lease_request: Option<models::RevokeDynamicSecretLeaseRequest>) -> Result<models::ConfigDeleteResponse, Error<DynamicSecretsRevokeLeaseError>> {
1956 let p_revoke_dynamic_secret_lease_request = revoke_dynamic_secret_lease_request;
1958
1959 let uri_str = format!("{}/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease", configuration.base_path);
1960 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1961
1962 if let Some(ref user_agent) = configuration.user_agent {
1963 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1964 }
1965 if let Some(ref token) = configuration.bearer_access_token {
1966 req_builder = req_builder.bearer_auth(token.to_owned());
1967 };
1968 req_builder = req_builder.json(&p_revoke_dynamic_secret_lease_request);
1969
1970 let req = req_builder.build()?;
1971 let resp = configuration.client.execute(req).await?;
1972
1973 let status = resp.status();
1974 let content_type = resp
1975 .headers()
1976 .get("content-type")
1977 .and_then(|v| v.to_str().ok())
1978 .unwrap_or("application/octet-stream");
1979 let content_type = super::ContentType::from(content_type);
1980
1981 if !status.is_client_error() && !status.is_server_error() {
1982 let content = resp.text().await?;
1983 match content_type {
1984 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1985 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigDeleteResponse`"))),
1986 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigDeleteResponse`")))),
1987 }
1988 } else {
1989 let content = resp.text().await?;
1990 let entity: Option<DynamicSecretsRevokeLeaseError> = serde_json::from_str(&content).ok();
1991 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1992 }
1993}
1994
1995pub async fn environments_create(configuration: &configuration::Configuration, project: &str, create_environment_request: Option<models::CreateEnvironmentRequest>) -> Result<models::EnvironmentCreateResponse, Error<EnvironmentsCreateError>> {
1997 let p_project = project;
1999 let p_create_environment_request = create_environment_request;
2000
2001 let uri_str = format!("{}/v3/environments", configuration.base_path);
2002 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2003
2004 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2005 if let Some(ref user_agent) = configuration.user_agent {
2006 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2007 }
2008 if let Some(ref token) = configuration.bearer_access_token {
2009 req_builder = req_builder.bearer_auth(token.to_owned());
2010 };
2011 req_builder = req_builder.json(&p_create_environment_request);
2012
2013 let req = req_builder.build()?;
2014 let resp = configuration.client.execute(req).await?;
2015
2016 let status = resp.status();
2017 let content_type = resp
2018 .headers()
2019 .get("content-type")
2020 .and_then(|v| v.to_str().ok())
2021 .unwrap_or("application/octet-stream");
2022 let content_type = super::ContentType::from(content_type);
2023
2024 if !status.is_client_error() && !status.is_server_error() {
2025 let content = resp.text().await?;
2026 match content_type {
2027 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2028 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnvironmentCreateResponse`"))),
2029 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EnvironmentCreateResponse`")))),
2030 }
2031 } else {
2032 let content = resp.text().await?;
2033 let entity: Option<EnvironmentsCreateError> = serde_json::from_str(&content).ok();
2034 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2035 }
2036}
2037
2038pub async fn environments_delete(configuration: &configuration::Configuration, project: &str, environment: &str) -> Result<(), Error<EnvironmentsDeleteError>> {
2040 let p_project = project;
2042 let p_environment = environment;
2043
2044 let uri_str = format!("{}/v3/environments/environment", configuration.base_path);
2045 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2046
2047 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2048 req_builder = req_builder.query(&[("environment", &p_environment.to_string())]);
2049 if let Some(ref user_agent) = configuration.user_agent {
2050 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2051 }
2052 if let Some(ref token) = configuration.bearer_access_token {
2053 req_builder = req_builder.bearer_auth(token.to_owned());
2054 };
2055
2056 let req = req_builder.build()?;
2057 let resp = configuration.client.execute(req).await?;
2058
2059 let status = resp.status();
2060
2061 if !status.is_client_error() && !status.is_server_error() {
2062 Ok(())
2063 } else {
2064 let content = resp.text().await?;
2065 let entity: Option<EnvironmentsDeleteError> = serde_json::from_str(&content).ok();
2066 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2067 }
2068}
2069
2070pub async fn environments_get(configuration: &configuration::Configuration, project: &str, environment: &str) -> Result<models::EnvironmentCreateResponse, Error<EnvironmentsGetError>> {
2072 let p_project = project;
2074 let p_environment = environment;
2075
2076 let uri_str = format!("{}/v3/environments/environment", configuration.base_path);
2077 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2078
2079 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2080 req_builder = req_builder.query(&[("environment", &p_environment.to_string())]);
2081 if let Some(ref user_agent) = configuration.user_agent {
2082 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2083 }
2084 if let Some(ref token) = configuration.bearer_access_token {
2085 req_builder = req_builder.bearer_auth(token.to_owned());
2086 };
2087
2088 let req = req_builder.build()?;
2089 let resp = configuration.client.execute(req).await?;
2090
2091 let status = resp.status();
2092 let content_type = resp
2093 .headers()
2094 .get("content-type")
2095 .and_then(|v| v.to_str().ok())
2096 .unwrap_or("application/octet-stream");
2097 let content_type = super::ContentType::from(content_type);
2098
2099 if !status.is_client_error() && !status.is_server_error() {
2100 let content = resp.text().await?;
2101 match content_type {
2102 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2103 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnvironmentCreateResponse`"))),
2104 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EnvironmentCreateResponse`")))),
2105 }
2106 } else {
2107 let content = resp.text().await?;
2108 let entity: Option<EnvironmentsGetError> = serde_json::from_str(&content).ok();
2109 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2110 }
2111}
2112
2113pub async fn environments_list(configuration: &configuration::Configuration, project: &str) -> Result<models::EnvironmentsListResponse, Error<EnvironmentsListError>> {
2115 let p_project = project;
2117
2118 let uri_str = format!("{}/v3/environments", configuration.base_path);
2119 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2120
2121 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2122 if let Some(ref user_agent) = configuration.user_agent {
2123 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2124 }
2125 if let Some(ref token) = configuration.bearer_access_token {
2126 req_builder = req_builder.bearer_auth(token.to_owned());
2127 };
2128
2129 let req = req_builder.build()?;
2130 let resp = configuration.client.execute(req).await?;
2131
2132 let status = resp.status();
2133 let content_type = resp
2134 .headers()
2135 .get("content-type")
2136 .and_then(|v| v.to_str().ok())
2137 .unwrap_or("application/octet-stream");
2138 let content_type = super::ContentType::from(content_type);
2139
2140 if !status.is_client_error() && !status.is_server_error() {
2141 let content = resp.text().await?;
2142 match content_type {
2143 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2144 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnvironmentsListResponse`"))),
2145 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EnvironmentsListResponse`")))),
2146 }
2147 } else {
2148 let content = resp.text().await?;
2149 let entity: Option<EnvironmentsListError> = serde_json::from_str(&content).ok();
2150 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2151 }
2152}
2153
2154pub async fn environments_rename(configuration: &configuration::Configuration, project: &str, environment: &str, rename_environment_request: Option<models::RenameEnvironmentRequest>) -> Result<models::EnvironmentCreateResponse, Error<EnvironmentsRenameError>> {
2156 let p_project = project;
2158 let p_environment = environment;
2159 let p_rename_environment_request = rename_environment_request;
2160
2161 let uri_str = format!("{}/v3/environments/environment", configuration.base_path);
2162 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2163
2164 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2165 req_builder = req_builder.query(&[("environment", &p_environment.to_string())]);
2166 if let Some(ref user_agent) = configuration.user_agent {
2167 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2168 }
2169 if let Some(ref token) = configuration.bearer_access_token {
2170 req_builder = req_builder.bearer_auth(token.to_owned());
2171 };
2172 req_builder = req_builder.json(&p_rename_environment_request);
2173
2174 let req = req_builder.build()?;
2175 let resp = configuration.client.execute(req).await?;
2176
2177 let status = resp.status();
2178 let content_type = resp
2179 .headers()
2180 .get("content-type")
2181 .and_then(|v| v.to_str().ok())
2182 .unwrap_or("application/octet-stream");
2183 let content_type = super::ContentType::from(content_type);
2184
2185 if !status.is_client_error() && !status.is_server_error() {
2186 let content = resp.text().await?;
2187 match content_type {
2188 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2189 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnvironmentCreateResponse`"))),
2190 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::EnvironmentCreateResponse`")))),
2191 }
2192 } else {
2193 let content = resp.text().await?;
2194 let entity: Option<EnvironmentsRenameError> = serde_json::from_str(&content).ok();
2195 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2196 }
2197}
2198
2199pub async fn get_options(configuration: &configuration::Configuration, integration: &str) -> Result<serde_json::Value, Error<GetOptionsError>> {
2201 let p_integration = integration;
2203
2204 let uri_str = format!("{}/v3/integrations/integration/options", configuration.base_path);
2205 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2206
2207 req_builder = req_builder.query(&[("integration", &p_integration.to_string())]);
2208 if let Some(ref user_agent) = configuration.user_agent {
2209 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2210 }
2211 if let Some(ref token) = configuration.bearer_access_token {
2212 req_builder = req_builder.bearer_auth(token.to_owned());
2213 };
2214
2215 let req = req_builder.build()?;
2216 let resp = configuration.client.execute(req).await?;
2217
2218 let status = resp.status();
2219 let content_type = resp
2220 .headers()
2221 .get("content-type")
2222 .and_then(|v| v.to_str().ok())
2223 .unwrap_or("application/octet-stream");
2224 let content_type = super::ContentType::from(content_type);
2225
2226 if !status.is_client_error() && !status.is_server_error() {
2227 let content = resp.text().await?;
2228 match content_type {
2229 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2230 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
2231 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
2232 }
2233 } else {
2234 let content = resp.text().await?;
2235 let entity: Option<GetOptionsError> = serde_json::from_str(&content).ok();
2236 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2237 }
2238}
2239
2240pub async fn groups_add_member(configuration: &configuration::Configuration, slug: &str, add_group_member_request: Option<models::AddGroupMemberRequest>) -> Result<(), Error<GroupsAddMemberError>> {
2242 let p_slug = slug;
2244 let p_add_group_member_request = add_group_member_request;
2245
2246 let uri_str = format!("{}/v3/workplace/groups/group/{slug}/members", configuration.base_path, slug=crate::apis::urlencode(p_slug));
2247 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2248
2249 if let Some(ref user_agent) = configuration.user_agent {
2250 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2251 }
2252 if let Some(ref token) = configuration.bearer_access_token {
2253 req_builder = req_builder.bearer_auth(token.to_owned());
2254 };
2255 req_builder = req_builder.json(&p_add_group_member_request);
2256
2257 let req = req_builder.build()?;
2258 let resp = configuration.client.execute(req).await?;
2259
2260 let status = resp.status();
2261
2262 if !status.is_client_error() && !status.is_server_error() {
2263 Ok(())
2264 } else {
2265 let content = resp.text().await?;
2266 let entity: Option<GroupsAddMemberError> = serde_json::from_str(&content).ok();
2267 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2268 }
2269}
2270
2271pub async fn groups_create(configuration: &configuration::Configuration, create_group_request: Option<models::CreateGroupRequest>) -> Result<models::GroupGetResponse, Error<GroupsCreateError>> {
2273 let p_create_group_request = create_group_request;
2275
2276 let uri_str = format!("{}/v3/workplace/groups", configuration.base_path);
2277 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2278
2279 if let Some(ref user_agent) = configuration.user_agent {
2280 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2281 }
2282 if let Some(ref token) = configuration.bearer_access_token {
2283 req_builder = req_builder.bearer_auth(token.to_owned());
2284 };
2285 req_builder = req_builder.json(&p_create_group_request);
2286
2287 let req = req_builder.build()?;
2288 let resp = configuration.client.execute(req).await?;
2289
2290 let status = resp.status();
2291 let content_type = resp
2292 .headers()
2293 .get("content-type")
2294 .and_then(|v| v.to_str().ok())
2295 .unwrap_or("application/octet-stream");
2296 let content_type = super::ContentType::from(content_type);
2297
2298 if !status.is_client_error() && !status.is_server_error() {
2299 let content = resp.text().await?;
2300 match content_type {
2301 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2302 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupGetResponse`"))),
2303 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupGetResponse`")))),
2304 }
2305 } else {
2306 let content = resp.text().await?;
2307 let entity: Option<GroupsCreateError> = serde_json::from_str(&content).ok();
2308 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2309 }
2310}
2311
2312pub async fn groups_delete(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<GroupsDeleteError>> {
2314 let p_slug = slug;
2316
2317 let uri_str = format!("{}/v3/workplace/groups/group/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
2318 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2319
2320 if let Some(ref user_agent) = configuration.user_agent {
2321 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2322 }
2323 if let Some(ref token) = configuration.bearer_access_token {
2324 req_builder = req_builder.bearer_auth(token.to_owned());
2325 };
2326
2327 let req = req_builder.build()?;
2328 let resp = configuration.client.execute(req).await?;
2329
2330 let status = resp.status();
2331
2332 if !status.is_client_error() && !status.is_server_error() {
2333 Ok(())
2334 } else {
2335 let content = resp.text().await?;
2336 let entity: Option<GroupsDeleteError> = serde_json::from_str(&content).ok();
2337 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2338 }
2339}
2340
2341pub async fn groups_delete_member(configuration: &configuration::Configuration, slug: &str, r#type: &str, member_slug: &str) -> Result<(), Error<GroupsDeleteMemberError>> {
2343 let p_slug = slug;
2345 let p_type = r#type;
2346 let p_member_slug = member_slug;
2347
2348 let uri_str = format!("{}/v3/workplace/groups/group/{slug}/members/{type}/{member_slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug), type=crate::apis::urlencode(p_type), member_slug=crate::apis::urlencode(p_member_slug));
2349 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2350
2351 if let Some(ref user_agent) = configuration.user_agent {
2352 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2353 }
2354 if let Some(ref token) = configuration.bearer_access_token {
2355 req_builder = req_builder.bearer_auth(token.to_owned());
2356 };
2357
2358 let req = req_builder.build()?;
2359 let resp = configuration.client.execute(req).await?;
2360
2361 let status = resp.status();
2362
2363 if !status.is_client_error() && !status.is_server_error() {
2364 Ok(())
2365 } else {
2366 let content = resp.text().await?;
2367 let entity: Option<GroupsDeleteMemberError> = serde_json::from_str(&content).ok();
2368 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2369 }
2370}
2371
2372pub async fn groups_get(configuration: &configuration::Configuration, slug: &str) -> Result<models::GroupGetResponse, Error<GroupsGetError>> {
2374 let p_slug = slug;
2376
2377 let uri_str = format!("{}/v3/workplace/groups/group/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
2378 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2379
2380 if let Some(ref user_agent) = configuration.user_agent {
2381 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2382 }
2383 if let Some(ref token) = configuration.bearer_access_token {
2384 req_builder = req_builder.bearer_auth(token.to_owned());
2385 };
2386
2387 let req = req_builder.build()?;
2388 let resp = configuration.client.execute(req).await?;
2389
2390 let status = resp.status();
2391 let content_type = resp
2392 .headers()
2393 .get("content-type")
2394 .and_then(|v| v.to_str().ok())
2395 .unwrap_or("application/octet-stream");
2396 let content_type = super::ContentType::from(content_type);
2397
2398 if !status.is_client_error() && !status.is_server_error() {
2399 let content = resp.text().await?;
2400 match content_type {
2401 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2402 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupGetResponse`"))),
2403 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupGetResponse`")))),
2404 }
2405 } else {
2406 let content = resp.text().await?;
2407 let entity: Option<GroupsGetError> = serde_json::from_str(&content).ok();
2408 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2409 }
2410}
2411
2412pub async fn groups_list(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::GroupsListResponse, Error<GroupsListError>> {
2414 let p_page = page;
2416 let p_per_page = per_page;
2417
2418 let uri_str = format!("{}/v3/workplace/groups", configuration.base_path);
2419 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2420
2421 if let Some(ref param_value) = p_page {
2422 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2423 }
2424 if let Some(ref param_value) = p_per_page {
2425 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
2426 }
2427 if let Some(ref user_agent) = configuration.user_agent {
2428 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2429 }
2430 if let Some(ref token) = configuration.bearer_access_token {
2431 req_builder = req_builder.bearer_auth(token.to_owned());
2432 };
2433
2434 let req = req_builder.build()?;
2435 let resp = configuration.client.execute(req).await?;
2436
2437 let status = resp.status();
2438 let content_type = resp
2439 .headers()
2440 .get("content-type")
2441 .and_then(|v| v.to_str().ok())
2442 .unwrap_or("application/octet-stream");
2443 let content_type = super::ContentType::from(content_type);
2444
2445 if !status.is_client_error() && !status.is_server_error() {
2446 let content = resp.text().await?;
2447 match content_type {
2448 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2449 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupsListResponse`"))),
2450 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupsListResponse`")))),
2451 }
2452 } else {
2453 let content = resp.text().await?;
2454 let entity: Option<GroupsListError> = serde_json::from_str(&content).ok();
2455 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2456 }
2457}
2458
2459pub async fn groups_update(configuration: &configuration::Configuration, slug: &str, update_group_request: Option<models::UpdateGroupRequest>) -> Result<models::GroupGetResponse, Error<GroupsUpdateError>> {
2461 let p_slug = slug;
2463 let p_update_group_request = update_group_request;
2464
2465 let uri_str = format!("{}/v3/workplace/groups/group/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
2466 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2467
2468 if let Some(ref user_agent) = configuration.user_agent {
2469 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2470 }
2471 if let Some(ref token) = configuration.bearer_access_token {
2472 req_builder = req_builder.bearer_auth(token.to_owned());
2473 };
2474 req_builder = req_builder.json(&p_update_group_request);
2475
2476 let req = req_builder.build()?;
2477 let resp = configuration.client.execute(req).await?;
2478
2479 let status = resp.status();
2480 let content_type = resp
2481 .headers()
2482 .get("content-type")
2483 .and_then(|v| v.to_str().ok())
2484 .unwrap_or("application/octet-stream");
2485 let content_type = super::ContentType::from(content_type);
2486
2487 if !status.is_client_error() && !status.is_server_error() {
2488 let content = resp.text().await?;
2489 match content_type {
2490 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2491 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupGetResponse`"))),
2492 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupGetResponse`")))),
2493 }
2494 } else {
2495 let content = resp.text().await?;
2496 let entity: Option<GroupsUpdateError> = serde_json::from_str(&content).ok();
2497 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2498 }
2499}
2500
2501pub async fn integrations_create(configuration: &configuration::Configuration, create_integration_request: Option<models::CreateIntegrationRequest>) -> Result<models::IntegrationGetResponse, Error<IntegrationsCreateError>> {
2503 let p_create_integration_request = create_integration_request;
2505
2506 let uri_str = format!("{}/v3/integrations", configuration.base_path);
2507 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2508
2509 if let Some(ref user_agent) = configuration.user_agent {
2510 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2511 }
2512 if let Some(ref token) = configuration.bearer_access_token {
2513 req_builder = req_builder.bearer_auth(token.to_owned());
2514 };
2515 req_builder = req_builder.json(&p_create_integration_request);
2516
2517 let req = req_builder.build()?;
2518 let resp = configuration.client.execute(req).await?;
2519
2520 let status = resp.status();
2521 let content_type = resp
2522 .headers()
2523 .get("content-type")
2524 .and_then(|v| v.to_str().ok())
2525 .unwrap_or("application/octet-stream");
2526 let content_type = super::ContentType::from(content_type);
2527
2528 if !status.is_client_error() && !status.is_server_error() {
2529 let content = resp.text().await?;
2530 match content_type {
2531 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2532 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationGetResponse`"))),
2533 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IntegrationGetResponse`")))),
2534 }
2535 } else {
2536 let content = resp.text().await?;
2537 let entity: Option<IntegrationsCreateError> = serde_json::from_str(&content).ok();
2538 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2539 }
2540}
2541
2542pub async fn integrations_delete(configuration: &configuration::Configuration, integration: &str) -> Result<serde_json::Value, Error<IntegrationsDeleteError>> {
2544 let p_integration = integration;
2546
2547 let uri_str = format!("{}/v3/integrations/integration", configuration.base_path);
2548 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2549
2550 req_builder = req_builder.query(&[("integration", &p_integration.to_string())]);
2551 if let Some(ref user_agent) = configuration.user_agent {
2552 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2553 }
2554 if let Some(ref token) = configuration.bearer_access_token {
2555 req_builder = req_builder.bearer_auth(token.to_owned());
2556 };
2557
2558 let req = req_builder.build()?;
2559 let resp = configuration.client.execute(req).await?;
2560
2561 let status = resp.status();
2562 let content_type = resp
2563 .headers()
2564 .get("content-type")
2565 .and_then(|v| v.to_str().ok())
2566 .unwrap_or("application/octet-stream");
2567 let content_type = super::ContentType::from(content_type);
2568
2569 if !status.is_client_error() && !status.is_server_error() {
2570 let content = resp.text().await?;
2571 match content_type {
2572 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2573 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
2574 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
2575 }
2576 } else {
2577 let content = resp.text().await?;
2578 let entity: Option<IntegrationsDeleteError> = serde_json::from_str(&content).ok();
2579 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2580 }
2581}
2582
2583pub async fn integrations_get(configuration: &configuration::Configuration, integration: &str) -> Result<models::IntegrationGetResponse, Error<IntegrationsGetError>> {
2585 let p_integration = integration;
2587
2588 let uri_str = format!("{}/v3/integrations/integration", configuration.base_path);
2589 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2590
2591 req_builder = req_builder.query(&[("integration", &p_integration.to_string())]);
2592 if let Some(ref user_agent) = configuration.user_agent {
2593 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2594 }
2595 if let Some(ref token) = configuration.bearer_access_token {
2596 req_builder = req_builder.bearer_auth(token.to_owned());
2597 };
2598
2599 let req = req_builder.build()?;
2600 let resp = configuration.client.execute(req).await?;
2601
2602 let status = resp.status();
2603 let content_type = resp
2604 .headers()
2605 .get("content-type")
2606 .and_then(|v| v.to_str().ok())
2607 .unwrap_or("application/octet-stream");
2608 let content_type = super::ContentType::from(content_type);
2609
2610 if !status.is_client_error() && !status.is_server_error() {
2611 let content = resp.text().await?;
2612 match content_type {
2613 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2614 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationGetResponse`"))),
2615 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IntegrationGetResponse`")))),
2616 }
2617 } else {
2618 let content = resp.text().await?;
2619 let entity: Option<IntegrationsGetError> = serde_json::from_str(&content).ok();
2620 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2621 }
2622}
2623
2624pub async fn integrations_list(configuration: &configuration::Configuration, ) -> Result<models::IntegrationsListResponse, Error<IntegrationsListError>> {
2626
2627 let uri_str = format!("{}/v3/integrations", configuration.base_path);
2628 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2629
2630 if let Some(ref user_agent) = configuration.user_agent {
2631 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2632 }
2633 if let Some(ref token) = configuration.bearer_access_token {
2634 req_builder = req_builder.bearer_auth(token.to_owned());
2635 };
2636
2637 let req = req_builder.build()?;
2638 let resp = configuration.client.execute(req).await?;
2639
2640 let status = resp.status();
2641 let content_type = resp
2642 .headers()
2643 .get("content-type")
2644 .and_then(|v| v.to_str().ok())
2645 .unwrap_or("application/octet-stream");
2646 let content_type = super::ContentType::from(content_type);
2647
2648 if !status.is_client_error() && !status.is_server_error() {
2649 let content = resp.text().await?;
2650 match content_type {
2651 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2652 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IntegrationsListResponse`"))),
2653 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IntegrationsListResponse`")))),
2654 }
2655 } else {
2656 let content = resp.text().await?;
2657 let entity: Option<IntegrationsListError> = serde_json::from_str(&content).ok();
2658 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2659 }
2660}
2661
2662pub async fn integrations_update(configuration: &configuration::Configuration, integration: &str, update_integration_request: Option<models::UpdateIntegrationRequest>) -> Result<serde_json::Value, Error<IntegrationsUpdateError>> {
2664 let p_integration = integration;
2666 let p_update_integration_request = update_integration_request;
2667
2668 let uri_str = format!("{}/v3/integrations/integration", configuration.base_path);
2669 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2670
2671 req_builder = req_builder.query(&[("integration", &p_integration.to_string())]);
2672 if let Some(ref user_agent) = configuration.user_agent {
2673 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2674 }
2675 if let Some(ref token) = configuration.bearer_access_token {
2676 req_builder = req_builder.bearer_auth(token.to_owned());
2677 };
2678 req_builder = req_builder.json(&p_update_integration_request);
2679
2680 let req = req_builder.build()?;
2681 let resp = configuration.client.execute(req).await?;
2682
2683 let status = resp.status();
2684 let content_type = resp
2685 .headers()
2686 .get("content-type")
2687 .and_then(|v| v.to_str().ok())
2688 .unwrap_or("application/octet-stream");
2689 let content_type = super::ContentType::from(content_type);
2690
2691 if !status.is_client_error() && !status.is_server_error() {
2692 let content = resp.text().await?;
2693 match content_type {
2694 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2695 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
2696 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
2697 }
2698 } else {
2699 let content = resp.text().await?;
2700 let entity: Option<IntegrationsUpdateError> = serde_json::from_str(&content).ok();
2701 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2702 }
2703}
2704
2705pub async fn invites_list(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::InvitesListResponse, Error<InvitesListError>> {
2707 let p_page = page;
2709 let p_per_page = per_page;
2710
2711 let uri_str = format!("{}/v3/workplace/invites", configuration.base_path);
2712 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2713
2714 if let Some(ref param_value) = p_page {
2715 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2716 }
2717 if let Some(ref param_value) = p_per_page {
2718 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
2719 }
2720 if let Some(ref user_agent) = configuration.user_agent {
2721 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2722 }
2723 if let Some(ref token) = configuration.bearer_access_token {
2724 req_builder = req_builder.bearer_auth(token.to_owned());
2725 };
2726
2727 let req = req_builder.build()?;
2728 let resp = configuration.client.execute(req).await?;
2729
2730 let status = resp.status();
2731 let content_type = resp
2732 .headers()
2733 .get("content-type")
2734 .and_then(|v| v.to_str().ok())
2735 .unwrap_or("application/octet-stream");
2736 let content_type = super::ContentType::from(content_type);
2737
2738 if !status.is_client_error() && !status.is_server_error() {
2739 let content = resp.text().await?;
2740 match content_type {
2741 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2742 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::InvitesListResponse`"))),
2743 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::InvitesListResponse`")))),
2744 }
2745 } else {
2746 let content = resp.text().await?;
2747 let entity: Option<InvitesListError> = serde_json::from_str(&content).ok();
2748 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2749 }
2750}
2751
2752pub async fn project_members_add(configuration: &configuration::Configuration, project: &str, add_project_member_request: Option<models::AddProjectMemberRequest>) -> Result<models::ProjectMemberAddResponse, Error<ProjectMembersAddError>> {
2754 let p_project = project;
2756 let p_add_project_member_request = add_project_member_request;
2757
2758 let uri_str = format!("{}/v3/projects/project/members", configuration.base_path);
2759 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2760
2761 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2762 if let Some(ref user_agent) = configuration.user_agent {
2763 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2764 }
2765 if let Some(ref token) = configuration.bearer_access_token {
2766 req_builder = req_builder.bearer_auth(token.to_owned());
2767 };
2768 req_builder = req_builder.json(&p_add_project_member_request);
2769
2770 let req = req_builder.build()?;
2771 let resp = configuration.client.execute(req).await?;
2772
2773 let status = resp.status();
2774 let content_type = resp
2775 .headers()
2776 .get("content-type")
2777 .and_then(|v| v.to_str().ok())
2778 .unwrap_or("application/octet-stream");
2779 let content_type = super::ContentType::from(content_type);
2780
2781 if !status.is_client_error() && !status.is_server_error() {
2782 let content = resp.text().await?;
2783 match content_type {
2784 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2785 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectMemberAddResponse`"))),
2786 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectMemberAddResponse`")))),
2787 }
2788 } else {
2789 let content = resp.text().await?;
2790 let entity: Option<ProjectMembersAddError> = serde_json::from_str(&content).ok();
2791 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2792 }
2793}
2794
2795pub async fn project_members_delete(configuration: &configuration::Configuration, r#type: &str, slug: &str, project: &str) -> Result<(), Error<ProjectMembersDeleteError>> {
2797 let p_type = r#type;
2799 let p_slug = slug;
2800 let p_project = project;
2801
2802 let uri_str = format!("{}/v3/projects/project/members/member/{type}/{slug}", configuration.base_path, type=crate::apis::urlencode(p_type), slug=crate::apis::urlencode(p_slug));
2803 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2804
2805 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2806 if let Some(ref user_agent) = configuration.user_agent {
2807 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2808 }
2809 if let Some(ref token) = configuration.bearer_access_token {
2810 req_builder = req_builder.bearer_auth(token.to_owned());
2811 };
2812
2813 let req = req_builder.build()?;
2814 let resp = configuration.client.execute(req).await?;
2815
2816 let status = resp.status();
2817
2818 if !status.is_client_error() && !status.is_server_error() {
2819 Ok(())
2820 } else {
2821 let content = resp.text().await?;
2822 let entity: Option<ProjectMembersDeleteError> = serde_json::from_str(&content).ok();
2823 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2824 }
2825}
2826
2827pub async fn project_members_get(configuration: &configuration::Configuration, project: &str, r#type: &str, slug: &str) -> Result<models::ProjectMemberAddResponse, Error<ProjectMembersGetError>> {
2829 let p_project = project;
2831 let p_type = r#type;
2832 let p_slug = slug;
2833
2834 let uri_str = format!("{}/v3/projects/project/members/member/{type}/{slug}", configuration.base_path, type=crate::apis::urlencode(p_type), slug=crate::apis::urlencode(p_slug));
2835 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2836
2837 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2838 if let Some(ref user_agent) = configuration.user_agent {
2839 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2840 }
2841 if let Some(ref token) = configuration.bearer_access_token {
2842 req_builder = req_builder.bearer_auth(token.to_owned());
2843 };
2844
2845 let req = req_builder.build()?;
2846 let resp = configuration.client.execute(req).await?;
2847
2848 let status = resp.status();
2849 let content_type = resp
2850 .headers()
2851 .get("content-type")
2852 .and_then(|v| v.to_str().ok())
2853 .unwrap_or("application/octet-stream");
2854 let content_type = super::ContentType::from(content_type);
2855
2856 if !status.is_client_error() && !status.is_server_error() {
2857 let content = resp.text().await?;
2858 match content_type {
2859 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2860 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectMemberAddResponse`"))),
2861 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectMemberAddResponse`")))),
2862 }
2863 } else {
2864 let content = resp.text().await?;
2865 let entity: Option<ProjectMembersGetError> = serde_json::from_str(&content).ok();
2866 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2867 }
2868}
2869
2870pub async fn project_members_list(configuration: &configuration::Configuration, project: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ProjectMembersListResponse, Error<ProjectMembersListError>> {
2872 let p_project = project;
2874 let p_page = page;
2875 let p_per_page = per_page;
2876
2877 let uri_str = format!("{}/v3/projects/project/members", configuration.base_path);
2878 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2879
2880 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2881 if let Some(ref param_value) = p_page {
2882 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
2883 }
2884 if let Some(ref param_value) = p_per_page {
2885 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
2886 }
2887 if let Some(ref user_agent) = configuration.user_agent {
2888 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2889 }
2890 if let Some(ref token) = configuration.bearer_access_token {
2891 req_builder = req_builder.bearer_auth(token.to_owned());
2892 };
2893
2894 let req = req_builder.build()?;
2895 let resp = configuration.client.execute(req).await?;
2896
2897 let status = resp.status();
2898 let content_type = resp
2899 .headers()
2900 .get("content-type")
2901 .and_then(|v| v.to_str().ok())
2902 .unwrap_or("application/octet-stream");
2903 let content_type = super::ContentType::from(content_type);
2904
2905 if !status.is_client_error() && !status.is_server_error() {
2906 let content = resp.text().await?;
2907 match content_type {
2908 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2909 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectMembersListResponse`"))),
2910 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectMembersListResponse`")))),
2911 }
2912 } else {
2913 let content = resp.text().await?;
2914 let entity: Option<ProjectMembersListError> = serde_json::from_str(&content).ok();
2915 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2916 }
2917}
2918
2919pub async fn project_members_update(configuration: &configuration::Configuration, r#type: &str, slug: &str, project: &str, update_project_member_request: Option<models::UpdateProjectMemberRequest>) -> Result<models::ProjectMemberAddResponse, Error<ProjectMembersUpdateError>> {
2921 let p_type = r#type;
2923 let p_slug = slug;
2924 let p_project = project;
2925 let p_update_project_member_request = update_project_member_request;
2926
2927 let uri_str = format!("{}/v3/projects/project/members/member/{type}/{slug}", configuration.base_path, type=crate::apis::urlencode(p_type), slug=crate::apis::urlencode(p_slug));
2928 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2929
2930 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
2931 if let Some(ref user_agent) = configuration.user_agent {
2932 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2933 }
2934 if let Some(ref token) = configuration.bearer_access_token {
2935 req_builder = req_builder.bearer_auth(token.to_owned());
2936 };
2937 req_builder = req_builder.json(&p_update_project_member_request);
2938
2939 let req = req_builder.build()?;
2940 let resp = configuration.client.execute(req).await?;
2941
2942 let status = resp.status();
2943 let content_type = resp
2944 .headers()
2945 .get("content-type")
2946 .and_then(|v| v.to_str().ok())
2947 .unwrap_or("application/octet-stream");
2948 let content_type = super::ContentType::from(content_type);
2949
2950 if !status.is_client_error() && !status.is_server_error() {
2951 let content = resp.text().await?;
2952 match content_type {
2953 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2954 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectMemberAddResponse`"))),
2955 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectMemberAddResponse`")))),
2956 }
2957 } else {
2958 let content = resp.text().await?;
2959 let entity: Option<ProjectMembersUpdateError> = serde_json::from_str(&content).ok();
2960 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2961 }
2962}
2963
2964pub async fn project_roles_create(configuration: &configuration::Configuration, create_project_role_request: Option<models::CreateProjectRoleRequest>) -> Result<models::ProjectRoleUpdateResponse, Error<ProjectRolesCreateError>> {
2966 let p_create_project_role_request = create_project_role_request;
2968
2969 let uri_str = format!("{}/v3/projects/roles", configuration.base_path);
2970 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2971
2972 if let Some(ref user_agent) = configuration.user_agent {
2973 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2974 }
2975 if let Some(ref token) = configuration.bearer_access_token {
2976 req_builder = req_builder.bearer_auth(token.to_owned());
2977 };
2978 req_builder = req_builder.json(&p_create_project_role_request);
2979
2980 let req = req_builder.build()?;
2981 let resp = configuration.client.execute(req).await?;
2982
2983 let status = resp.status();
2984 let content_type = resp
2985 .headers()
2986 .get("content-type")
2987 .and_then(|v| v.to_str().ok())
2988 .unwrap_or("application/octet-stream");
2989 let content_type = super::ContentType::from(content_type);
2990
2991 if !status.is_client_error() && !status.is_server_error() {
2992 let content = resp.text().await?;
2993 match content_type {
2994 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2995 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectRoleUpdateResponse`"))),
2996 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectRoleUpdateResponse`")))),
2997 }
2998 } else {
2999 let content = resp.text().await?;
3000 let entity: Option<ProjectRolesCreateError> = serde_json::from_str(&content).ok();
3001 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3002 }
3003}
3004
3005pub async fn project_roles_delete(configuration: &configuration::Configuration, role: &str) -> Result<(), Error<ProjectRolesDeleteError>> {
3007 let p_role = role;
3009
3010 let uri_str = format!("{}/v3/projects/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
3011 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3012
3013 if let Some(ref user_agent) = configuration.user_agent {
3014 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3015 }
3016 if let Some(ref token) = configuration.bearer_access_token {
3017 req_builder = req_builder.bearer_auth(token.to_owned());
3018 };
3019
3020 let req = req_builder.build()?;
3021 let resp = configuration.client.execute(req).await?;
3022
3023 let status = resp.status();
3024
3025 if !status.is_client_error() && !status.is_server_error() {
3026 Ok(())
3027 } else {
3028 let content = resp.text().await?;
3029 let entity: Option<ProjectRolesDeleteError> = serde_json::from_str(&content).ok();
3030 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3031 }
3032}
3033
3034pub async fn project_roles_get(configuration: &configuration::Configuration, role: &str) -> Result<models::ProjectRoleGetResponse, Error<ProjectRolesGetError>> {
3036 let p_role = role;
3038
3039 let uri_str = format!("{}/v3/projects/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
3040 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3041
3042 if let Some(ref user_agent) = configuration.user_agent {
3043 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3044 }
3045 if let Some(ref token) = configuration.bearer_access_token {
3046 req_builder = req_builder.bearer_auth(token.to_owned());
3047 };
3048
3049 let req = req_builder.build()?;
3050 let resp = configuration.client.execute(req).await?;
3051
3052 let status = resp.status();
3053 let content_type = resp
3054 .headers()
3055 .get("content-type")
3056 .and_then(|v| v.to_str().ok())
3057 .unwrap_or("application/octet-stream");
3058 let content_type = super::ContentType::from(content_type);
3059
3060 if !status.is_client_error() && !status.is_server_error() {
3061 let content = resp.text().await?;
3062 match content_type {
3063 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3064 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectRoleGetResponse`"))),
3065 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectRoleGetResponse`")))),
3066 }
3067 } else {
3068 let content = resp.text().await?;
3069 let entity: Option<ProjectRolesGetError> = serde_json::from_str(&content).ok();
3070 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3071 }
3072}
3073
3074pub async fn project_roles_list(configuration: &configuration::Configuration, ) -> Result<models::ProjectRolesListResponse, Error<ProjectRolesListError>> {
3076
3077 let uri_str = format!("{}/v3/projects/roles", configuration.base_path);
3078 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3079
3080 if let Some(ref user_agent) = configuration.user_agent {
3081 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3082 }
3083 if let Some(ref token) = configuration.bearer_access_token {
3084 req_builder = req_builder.bearer_auth(token.to_owned());
3085 };
3086
3087 let req = req_builder.build()?;
3088 let resp = configuration.client.execute(req).await?;
3089
3090 let status = resp.status();
3091 let content_type = resp
3092 .headers()
3093 .get("content-type")
3094 .and_then(|v| v.to_str().ok())
3095 .unwrap_or("application/octet-stream");
3096 let content_type = super::ContentType::from(content_type);
3097
3098 if !status.is_client_error() && !status.is_server_error() {
3099 let content = resp.text().await?;
3100 match content_type {
3101 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3102 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectRolesListResponse`"))),
3103 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectRolesListResponse`")))),
3104 }
3105 } else {
3106 let content = resp.text().await?;
3107 let entity: Option<ProjectRolesListError> = serde_json::from_str(&content).ok();
3108 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3109 }
3110}
3111
3112pub async fn project_roles_list_permissions(configuration: &configuration::Configuration, ) -> Result<models::ProjectPermissionsResponse, Error<ProjectRolesListPermissionsError>> {
3114
3115 let uri_str = format!("{}/v3/projects/permissions", configuration.base_path);
3116 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3117
3118 if let Some(ref user_agent) = configuration.user_agent {
3119 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3120 }
3121 if let Some(ref token) = configuration.bearer_access_token {
3122 req_builder = req_builder.bearer_auth(token.to_owned());
3123 };
3124
3125 let req = req_builder.build()?;
3126 let resp = configuration.client.execute(req).await?;
3127
3128 let status = resp.status();
3129 let content_type = resp
3130 .headers()
3131 .get("content-type")
3132 .and_then(|v| v.to_str().ok())
3133 .unwrap_or("application/octet-stream");
3134 let content_type = super::ContentType::from(content_type);
3135
3136 if !status.is_client_error() && !status.is_server_error() {
3137 let content = resp.text().await?;
3138 match content_type {
3139 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3140 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectPermissionsResponse`"))),
3141 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectPermissionsResponse`")))),
3142 }
3143 } else {
3144 let content = resp.text().await?;
3145 let entity: Option<ProjectRolesListPermissionsError> = serde_json::from_str(&content).ok();
3146 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3147 }
3148}
3149
3150pub async fn project_roles_update(configuration: &configuration::Configuration, role: &str, update_project_role_request: Option<models::UpdateProjectRoleRequest>) -> Result<models::ProjectRoleUpdateResponse, Error<ProjectRolesUpdateError>> {
3152 let p_role = role;
3154 let p_update_project_role_request = update_project_role_request;
3155
3156 let uri_str = format!("{}/v3/projects/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
3157 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3158
3159 if let Some(ref user_agent) = configuration.user_agent {
3160 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3161 }
3162 if let Some(ref token) = configuration.bearer_access_token {
3163 req_builder = req_builder.bearer_auth(token.to_owned());
3164 };
3165 req_builder = req_builder.json(&p_update_project_role_request);
3166
3167 let req = req_builder.build()?;
3168 let resp = configuration.client.execute(req).await?;
3169
3170 let status = resp.status();
3171 let content_type = resp
3172 .headers()
3173 .get("content-type")
3174 .and_then(|v| v.to_str().ok())
3175 .unwrap_or("application/octet-stream");
3176 let content_type = super::ContentType::from(content_type);
3177
3178 if !status.is_client_error() && !status.is_server_error() {
3179 let content = resp.text().await?;
3180 match content_type {
3181 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3182 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectRoleUpdateResponse`"))),
3183 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectRoleUpdateResponse`")))),
3184 }
3185 } else {
3186 let content = resp.text().await?;
3187 let entity: Option<ProjectRolesUpdateError> = serde_json::from_str(&content).ok();
3188 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3189 }
3190}
3191
3192pub async fn projects_create(configuration: &configuration::Configuration, create_project_request: Option<models::CreateProjectRequest>) -> Result<models::ProjectCreateResponse, Error<ProjectsCreateError>> {
3194 let p_create_project_request = create_project_request;
3196
3197 let uri_str = format!("{}/v3/projects", configuration.base_path);
3198 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3199
3200 if let Some(ref user_agent) = configuration.user_agent {
3201 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3202 }
3203 if let Some(ref token) = configuration.bearer_access_token {
3204 req_builder = req_builder.bearer_auth(token.to_owned());
3205 };
3206 req_builder = req_builder.json(&p_create_project_request);
3207
3208 let req = req_builder.build()?;
3209 let resp = configuration.client.execute(req).await?;
3210
3211 let status = resp.status();
3212 let content_type = resp
3213 .headers()
3214 .get("content-type")
3215 .and_then(|v| v.to_str().ok())
3216 .unwrap_or("application/octet-stream");
3217 let content_type = super::ContentType::from(content_type);
3218
3219 if !status.is_client_error() && !status.is_server_error() {
3220 let content = resp.text().await?;
3221 match content_type {
3222 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3223 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectCreateResponse`"))),
3224 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectCreateResponse`")))),
3225 }
3226 } else {
3227 let content = resp.text().await?;
3228 let entity: Option<ProjectsCreateError> = serde_json::from_str(&content).ok();
3229 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3230 }
3231}
3232
3233pub async fn projects_delete(configuration: &configuration::Configuration, delete_project_request: Option<models::DeleteProjectRequest>) -> Result<(), Error<ProjectsDeleteError>> {
3235 let p_delete_project_request = delete_project_request;
3237
3238 let uri_str = format!("{}/v3/projects/project", configuration.base_path);
3239 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3240
3241 if let Some(ref user_agent) = configuration.user_agent {
3242 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3243 }
3244 if let Some(ref token) = configuration.bearer_access_token {
3245 req_builder = req_builder.bearer_auth(token.to_owned());
3246 };
3247 req_builder = req_builder.json(&p_delete_project_request);
3248
3249 let req = req_builder.build()?;
3250 let resp = configuration.client.execute(req).await?;
3251
3252 let status = resp.status();
3253
3254 if !status.is_client_error() && !status.is_server_error() {
3255 Ok(())
3256 } else {
3257 let content = resp.text().await?;
3258 let entity: Option<ProjectsDeleteError> = serde_json::from_str(&content).ok();
3259 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3260 }
3261}
3262
3263pub async fn projects_get(configuration: &configuration::Configuration, project: &str) -> Result<models::ProjectCreateResponse, Error<ProjectsGetError>> {
3265 let p_project = project;
3267
3268 let uri_str = format!("{}/v3/projects/project", configuration.base_path);
3269 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3270
3271 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3272 if let Some(ref user_agent) = configuration.user_agent {
3273 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3274 }
3275 if let Some(ref token) = configuration.bearer_access_token {
3276 req_builder = req_builder.bearer_auth(token.to_owned());
3277 };
3278
3279 let req = req_builder.build()?;
3280 let resp = configuration.client.execute(req).await?;
3281
3282 let status = resp.status();
3283 let content_type = resp
3284 .headers()
3285 .get("content-type")
3286 .and_then(|v| v.to_str().ok())
3287 .unwrap_or("application/octet-stream");
3288 let content_type = super::ContentType::from(content_type);
3289
3290 if !status.is_client_error() && !status.is_server_error() {
3291 let content = resp.text().await?;
3292 match content_type {
3293 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3294 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectCreateResponse`"))),
3295 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectCreateResponse`")))),
3296 }
3297 } else {
3298 let content = resp.text().await?;
3299 let entity: Option<ProjectsGetError> = serde_json::from_str(&content).ok();
3300 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3301 }
3302}
3303
3304pub async fn projects_list(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::ProjectsListResponse, Error<ProjectsListError>> {
3306 let p_page = page;
3308 let p_per_page = per_page;
3309
3310 let uri_str = format!("{}/v3/projects", configuration.base_path);
3311 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3312
3313 if let Some(ref param_value) = p_page {
3314 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3315 }
3316 if let Some(ref param_value) = p_per_page {
3317 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
3318 }
3319 if let Some(ref user_agent) = configuration.user_agent {
3320 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3321 }
3322 if let Some(ref token) = configuration.bearer_access_token {
3323 req_builder = req_builder.bearer_auth(token.to_owned());
3324 };
3325
3326 let req = req_builder.build()?;
3327 let resp = configuration.client.execute(req).await?;
3328
3329 let status = resp.status();
3330 let content_type = resp
3331 .headers()
3332 .get("content-type")
3333 .and_then(|v| v.to_str().ok())
3334 .unwrap_or("application/octet-stream");
3335 let content_type = super::ContentType::from(content_type);
3336
3337 if !status.is_client_error() && !status.is_server_error() {
3338 let content = resp.text().await?;
3339 match content_type {
3340 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3341 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsListResponse`"))),
3342 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectsListResponse`")))),
3343 }
3344 } else {
3345 let content = resp.text().await?;
3346 let entity: Option<ProjectsListError> = serde_json::from_str(&content).ok();
3347 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3348 }
3349}
3350
3351pub async fn projects_update(configuration: &configuration::Configuration, update_project_request: Option<models::UpdateProjectRequest>) -> Result<models::ProjectCreateResponse, Error<ProjectsUpdateError>> {
3353 let p_update_project_request = update_project_request;
3355
3356 let uri_str = format!("{}/v3/projects/project", configuration.base_path);
3357 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3358
3359 if let Some(ref user_agent) = configuration.user_agent {
3360 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3361 }
3362 if let Some(ref token) = configuration.bearer_access_token {
3363 req_builder = req_builder.bearer_auth(token.to_owned());
3364 };
3365 req_builder = req_builder.json(&p_update_project_request);
3366
3367 let req = req_builder.build()?;
3368 let resp = configuration.client.execute(req).await?;
3369
3370 let status = resp.status();
3371 let content_type = resp
3372 .headers()
3373 .get("content-type")
3374 .and_then(|v| v.to_str().ok())
3375 .unwrap_or("application/octet-stream");
3376 let content_type = super::ContentType::from(content_type);
3377
3378 if !status.is_client_error() && !status.is_server_error() {
3379 let content = resp.text().await?;
3380 match content_type {
3381 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3382 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectCreateResponse`"))),
3383 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProjectCreateResponse`")))),
3384 }
3385 } else {
3386 let content = resp.text().await?;
3387 let entity: Option<ProjectsUpdateError> = serde_json::from_str(&content).ok();
3388 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3389 }
3390}
3391
3392pub async fn retrieve_member(configuration: &configuration::Configuration, group_slug: &str, member_type: &str, member_slug: &str) -> Result<models::GroupGetResponse, Error<RetrieveMemberError>> {
3394 let p_group_slug = group_slug;
3396 let p_member_type = member_type;
3397 let p_member_slug = member_slug;
3398
3399 let uri_str = format!("{}/v3/workplace/groups/group/{group_slug}/members/{member_type}/{member_slug}", configuration.base_path, group_slug=crate::apis::urlencode(p_group_slug), member_type=crate::apis::urlencode(p_member_type), member_slug=crate::apis::urlencode(p_member_slug));
3400 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3401
3402 if let Some(ref user_agent) = configuration.user_agent {
3403 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3404 }
3405 if let Some(ref token) = configuration.bearer_access_token {
3406 req_builder = req_builder.bearer_auth(token.to_owned());
3407 };
3408
3409 let req = req_builder.build()?;
3410 let resp = configuration.client.execute(req).await?;
3411
3412 let status = resp.status();
3413 let content_type = resp
3414 .headers()
3415 .get("content-type")
3416 .and_then(|v| v.to_str().ok())
3417 .unwrap_or("application/octet-stream");
3418 let content_type = super::ContentType::from(content_type);
3419
3420 if !status.is_client_error() && !status.is_server_error() {
3421 let content = resp.text().await?;
3422 match content_type {
3423 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3424 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupGetResponse`"))),
3425 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupGetResponse`")))),
3426 }
3427 } else {
3428 let content = resp.text().await?;
3429 let entity: Option<RetrieveMemberError> = serde_json::from_str(&content).ok();
3430 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3431 }
3432}
3433
3434pub async fn secrets_delete(configuration: &configuration::Configuration, project: &str, config: &str, name: &str) -> Result<(), Error<SecretsDeleteError>> {
3436 let p_project = project;
3438 let p_config = config;
3439 let p_name = name;
3440
3441 let uri_str = format!("{}/v3/configs/config/secret", configuration.base_path);
3442 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3443
3444 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3445 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
3446 req_builder = req_builder.query(&[("name", &p_name.to_string())]);
3447 if let Some(ref user_agent) = configuration.user_agent {
3448 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3449 }
3450 if let Some(ref token) = configuration.bearer_access_token {
3451 req_builder = req_builder.bearer_auth(token.to_owned());
3452 };
3453
3454 let req = req_builder.build()?;
3455 let resp = configuration.client.execute(req).await?;
3456
3457 let status = resp.status();
3458
3459 if !status.is_client_error() && !status.is_server_error() {
3460 Ok(())
3461 } else {
3462 let content = resp.text().await?;
3463 let entity: Option<SecretsDeleteError> = serde_json::from_str(&content).ok();
3464 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3465 }
3466}
3467
3468pub async fn secrets_download(configuration: &configuration::Configuration, project: &str, config: &str, format: Option<&str>, name_transformer: Option<&str>, include_dynamic_secrets: Option<bool>, dynamic_secrets_ttl_sec: Option<i32>, secrets: Option<&str>) -> Result<models::SecretsDownloadResponse, Error<SecretsDownloadError>> {
3470 let p_project = project;
3472 let p_config = config;
3473 let p_format = format;
3474 let p_name_transformer = name_transformer;
3475 let p_include_dynamic_secrets = include_dynamic_secrets;
3476 let p_dynamic_secrets_ttl_sec = dynamic_secrets_ttl_sec;
3477 let p_secrets = secrets;
3478
3479 let uri_str = format!("{}/v3/configs/config/secrets/download", configuration.base_path);
3480 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3481
3482 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3483 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
3484 if let Some(ref param_value) = p_format {
3485 req_builder = req_builder.query(&[("format", ¶m_value.to_string())]);
3486 }
3487 if let Some(ref param_value) = p_name_transformer {
3488 req_builder = req_builder.query(&[("name_transformer", ¶m_value.to_string())]);
3489 }
3490 if let Some(ref param_value) = p_include_dynamic_secrets {
3491 req_builder = req_builder.query(&[("include_dynamic_secrets", ¶m_value.to_string())]);
3492 }
3493 if let Some(ref param_value) = p_dynamic_secrets_ttl_sec {
3494 req_builder = req_builder.query(&[("dynamic_secrets_ttl_sec", ¶m_value.to_string())]);
3495 }
3496 if let Some(ref param_value) = p_secrets {
3497 req_builder = req_builder.query(&[("secrets", ¶m_value.to_string())]);
3498 }
3499 if let Some(ref user_agent) = configuration.user_agent {
3500 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3501 }
3502 if let Some(ref token) = configuration.bearer_access_token {
3503 req_builder = req_builder.bearer_auth(token.to_owned());
3504 };
3505
3506 let req = req_builder.build()?;
3507 let resp = configuration.client.execute(req).await?;
3508
3509 let status = resp.status();
3510 let content_type = resp
3511 .headers()
3512 .get("content-type")
3513 .and_then(|v| v.to_str().ok())
3514 .unwrap_or("application/octet-stream");
3515 let content_type = super::ContentType::from(content_type);
3516
3517 if !status.is_client_error() && !status.is_server_error() {
3518 let content = resp.text().await?;
3519 match content_type {
3520 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3521 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretsDownloadResponse`"))),
3522 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretsDownloadResponse`")))),
3523 }
3524 } else {
3525 let content = resp.text().await?;
3526 let entity: Option<SecretsDownloadError> = serde_json::from_str(&content).ok();
3527 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3528 }
3529}
3530
3531pub async fn secrets_get(configuration: &configuration::Configuration, project: &str, config: &str, name: &str) -> Result<models::SecretGetResponse, Error<SecretsGetError>> {
3533 let p_project = project;
3535 let p_config = config;
3536 let p_name = name;
3537
3538 let uri_str = format!("{}/v3/configs/config/secret", configuration.base_path);
3539 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3540
3541 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3542 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
3543 req_builder = req_builder.query(&[("name", &p_name.to_string())]);
3544 if let Some(ref user_agent) = configuration.user_agent {
3545 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3546 }
3547 if let Some(ref token) = configuration.bearer_access_token {
3548 req_builder = req_builder.bearer_auth(token.to_owned());
3549 };
3550
3551 let req = req_builder.build()?;
3552 let resp = configuration.client.execute(req).await?;
3553
3554 let status = resp.status();
3555 let content_type = resp
3556 .headers()
3557 .get("content-type")
3558 .and_then(|v| v.to_str().ok())
3559 .unwrap_or("application/octet-stream");
3560 let content_type = super::ContentType::from(content_type);
3561
3562 if !status.is_client_error() && !status.is_server_error() {
3563 let content = resp.text().await?;
3564 match content_type {
3565 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3566 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretGetResponse`"))),
3567 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretGetResponse`")))),
3568 }
3569 } else {
3570 let content = resp.text().await?;
3571 let entity: Option<SecretsGetError> = serde_json::from_str(&content).ok();
3572 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3573 }
3574}
3575
3576pub async fn secrets_list(configuration: &configuration::Configuration, project: &str, config: &str, accepts: Option<&str>, include_dynamic_secrets: Option<bool>, dynamic_secrets_ttl_sec: Option<i32>, secrets: Option<&str>, include_managed_secrets: Option<bool>) -> Result<models::SecretsListResponse, Error<SecretsListError>> {
3578 let p_project = project;
3580 let p_config = config;
3581 let p_accepts = accepts;
3582 let p_include_dynamic_secrets = include_dynamic_secrets;
3583 let p_dynamic_secrets_ttl_sec = dynamic_secrets_ttl_sec;
3584 let p_secrets = secrets;
3585 let p_include_managed_secrets = include_managed_secrets;
3586
3587 let uri_str = format!("{}/v3/configs/config/secrets", configuration.base_path);
3588 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3589
3590 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3591 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
3592 if let Some(ref param_value) = p_include_dynamic_secrets {
3593 req_builder = req_builder.query(&[("include_dynamic_secrets", ¶m_value.to_string())]);
3594 }
3595 if let Some(ref param_value) = p_dynamic_secrets_ttl_sec {
3596 req_builder = req_builder.query(&[("dynamic_secrets_ttl_sec", ¶m_value.to_string())]);
3597 }
3598 if let Some(ref param_value) = p_secrets {
3599 req_builder = req_builder.query(&[("secrets", ¶m_value.to_string())]);
3600 }
3601 if let Some(ref param_value) = p_include_managed_secrets {
3602 req_builder = req_builder.query(&[("include_managed_secrets", ¶m_value.to_string())]);
3603 }
3604 if let Some(ref user_agent) = configuration.user_agent {
3605 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3606 }
3607 if let Some(param_value) = p_accepts {
3608 req_builder = req_builder.header("accepts", param_value.to_string());
3609 }
3610 if let Some(ref token) = configuration.bearer_access_token {
3611 req_builder = req_builder.bearer_auth(token.to_owned());
3612 };
3613
3614 let req = req_builder.build()?;
3615 let resp = configuration.client.execute(req).await?;
3616
3617 let status = resp.status();
3618 let content_type = resp
3619 .headers()
3620 .get("content-type")
3621 .and_then(|v| v.to_str().ok())
3622 .unwrap_or("application/octet-stream");
3623 let content_type = super::ContentType::from(content_type);
3624
3625 if !status.is_client_error() && !status.is_server_error() {
3626 let content = resp.text().await?;
3627 match content_type {
3628 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3629 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretsListResponse`"))),
3630 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretsListResponse`")))),
3631 }
3632 } else {
3633 let content = resp.text().await?;
3634 let entity: Option<SecretsListError> = serde_json::from_str(&content).ok();
3635 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3636 }
3637}
3638
3639pub async fn secrets_names(configuration: &configuration::Configuration, project: &str, config: &str, include_dynamic_secrets: Option<bool>, include_managed_secrets: Option<bool>) -> Result<models::SecretNamesResponse, Error<SecretsNamesError>> {
3641 let p_project = project;
3643 let p_config = config;
3644 let p_include_dynamic_secrets = include_dynamic_secrets;
3645 let p_include_managed_secrets = include_managed_secrets;
3646
3647 let uri_str = format!("{}/v3/configs/config/secrets/names", configuration.base_path);
3648 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3649
3650 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
3651 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
3652 if let Some(ref param_value) = p_include_dynamic_secrets {
3653 req_builder = req_builder.query(&[("include_dynamic_secrets", ¶m_value.to_string())]);
3654 }
3655 if let Some(ref param_value) = p_include_managed_secrets {
3656 req_builder = req_builder.query(&[("include_managed_secrets", ¶m_value.to_string())]);
3657 }
3658 if let Some(ref user_agent) = configuration.user_agent {
3659 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3660 }
3661 if let Some(ref token) = configuration.bearer_access_token {
3662 req_builder = req_builder.bearer_auth(token.to_owned());
3663 };
3664
3665 let req = req_builder.build()?;
3666 let resp = configuration.client.execute(req).await?;
3667
3668 let status = resp.status();
3669 let content_type = resp
3670 .headers()
3671 .get("content-type")
3672 .and_then(|v| v.to_str().ok())
3673 .unwrap_or("application/octet-stream");
3674 let content_type = super::ContentType::from(content_type);
3675
3676 if !status.is_client_error() && !status.is_server_error() {
3677 let content = resp.text().await?;
3678 match content_type {
3679 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3680 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretNamesResponse`"))),
3681 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretNamesResponse`")))),
3682 }
3683 } else {
3684 let content = resp.text().await?;
3685 let entity: Option<SecretsNamesError> = serde_json::from_str(&content).ok();
3686 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3687 }
3688}
3689
3690pub async fn secrets_update(configuration: &configuration::Configuration, update_secrets_request: Option<models::UpdateSecretsRequest>) -> Result<models::SecretsUpdateResponse, Error<SecretsUpdateError>> {
3692 let p_update_secrets_request = update_secrets_request;
3694
3695 let uri_str = format!("{}/v3/configs/config/secrets", configuration.base_path);
3696 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3697
3698 if let Some(ref user_agent) = configuration.user_agent {
3699 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3700 }
3701 if let Some(ref token) = configuration.bearer_access_token {
3702 req_builder = req_builder.bearer_auth(token.to_owned());
3703 };
3704 req_builder = req_builder.json(&p_update_secrets_request);
3705
3706 let req = req_builder.build()?;
3707 let resp = configuration.client.execute(req).await?;
3708
3709 let status = resp.status();
3710 let content_type = resp
3711 .headers()
3712 .get("content-type")
3713 .and_then(|v| v.to_str().ok())
3714 .unwrap_or("application/octet-stream");
3715 let content_type = super::ContentType::from(content_type);
3716
3717 if !status.is_client_error() && !status.is_server_error() {
3718 let content = resp.text().await?;
3719 match content_type {
3720 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3721 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretsUpdateResponse`"))),
3722 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretsUpdateResponse`")))),
3723 }
3724 } else {
3725 let content = resp.text().await?;
3726 let entity: Option<SecretsUpdateError> = serde_json::from_str(&content).ok();
3727 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3728 }
3729}
3730
3731pub async fn secrets_update_note(configuration: &configuration::Configuration, project: Option<&str>, update_secret_note_request: Option<models::UpdateSecretNoteRequest>) -> Result<models::SecretNoteResponse, Error<SecretsUpdateNoteError>> {
3733 let p_project = project;
3735 let p_update_secret_note_request = update_secret_note_request;
3736
3737 let uri_str = format!("{}/v3/projects/project/note", configuration.base_path);
3738 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3739
3740 if let Some(ref param_value) = p_project {
3741 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
3742 }
3743 if let Some(ref user_agent) = configuration.user_agent {
3744 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3745 }
3746 if let Some(ref token) = configuration.bearer_access_token {
3747 req_builder = req_builder.bearer_auth(token.to_owned());
3748 };
3749 req_builder = req_builder.json(&p_update_secret_note_request);
3750
3751 let req = req_builder.build()?;
3752 let resp = configuration.client.execute(req).await?;
3753
3754 let status = resp.status();
3755 let content_type = resp
3756 .headers()
3757 .get("content-type")
3758 .and_then(|v| v.to_str().ok())
3759 .unwrap_or("application/octet-stream");
3760 let content_type = super::ContentType::from(content_type);
3761
3762 if !status.is_client_error() && !status.is_server_error() {
3763 let content = resp.text().await?;
3764 match content_type {
3765 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3766 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SecretNoteResponse`"))),
3767 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SecretNoteResponse`")))),
3768 }
3769 } else {
3770 let content = resp.text().await?;
3771 let entity: Option<SecretsUpdateNoteError> = serde_json::from_str(&content).ok();
3772 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3773 }
3774}
3775
3776pub async fn service_account_tokens_create(configuration: &configuration::Configuration, service_account: &str, create_service_account_token_request: Option<models::CreateServiceAccountTokenRequest>) -> Result<models::ServiceAccountTokenCreateResponse, Error<ServiceAccountTokensCreateError>> {
3778 let p_service_account = service_account;
3780 let p_create_service_account_token_request = create_service_account_token_request;
3781
3782 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{service_account}/tokens", configuration.base_path, service_account=crate::apis::urlencode(p_service_account));
3783 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3784
3785 if let Some(ref user_agent) = configuration.user_agent {
3786 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3787 }
3788 if let Some(ref token) = configuration.bearer_access_token {
3789 req_builder = req_builder.bearer_auth(token.to_owned());
3790 };
3791 req_builder = req_builder.json(&p_create_service_account_token_request);
3792
3793 let req = req_builder.build()?;
3794 let resp = configuration.client.execute(req).await?;
3795
3796 let status = resp.status();
3797 let content_type = resp
3798 .headers()
3799 .get("content-type")
3800 .and_then(|v| v.to_str().ok())
3801 .unwrap_or("application/octet-stream");
3802 let content_type = super::ContentType::from(content_type);
3803
3804 if !status.is_client_error() && !status.is_server_error() {
3805 let content = resp.text().await?;
3806 match content_type {
3807 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3808 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountTokenCreateResponse`"))),
3809 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountTokenCreateResponse`")))),
3810 }
3811 } else {
3812 let content = resp.text().await?;
3813 let entity: Option<ServiceAccountTokensCreateError> = serde_json::from_str(&content).ok();
3814 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3815 }
3816}
3817
3818pub async fn service_account_tokens_delete(configuration: &configuration::Configuration, service_account: &str, api_token: &str) -> Result<(), Error<ServiceAccountTokensDeleteError>> {
3820 let p_service_account = service_account;
3822 let p_api_token = api_token;
3823
3824 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token}", configuration.base_path, service_account=crate::apis::urlencode(p_service_account), api_token=crate::apis::urlencode(p_api_token));
3825 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3826
3827 if let Some(ref user_agent) = configuration.user_agent {
3828 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3829 }
3830 if let Some(ref token) = configuration.bearer_access_token {
3831 req_builder = req_builder.bearer_auth(token.to_owned());
3832 };
3833
3834 let req = req_builder.build()?;
3835 let resp = configuration.client.execute(req).await?;
3836
3837 let status = resp.status();
3838
3839 if !status.is_client_error() && !status.is_server_error() {
3840 Ok(())
3841 } else {
3842 let content = resp.text().await?;
3843 let entity: Option<ServiceAccountTokensDeleteError> = serde_json::from_str(&content).ok();
3844 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3845 }
3846}
3847
3848pub async fn service_account_tokens_get(configuration: &configuration::Configuration, service_account: &str, api_token: &str) -> Result<models::ServiceAccountTokenGetResponse, Error<ServiceAccountTokensGetError>> {
3850 let p_service_account = service_account;
3852 let p_api_token = api_token;
3853
3854 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token}", configuration.base_path, service_account=crate::apis::urlencode(p_service_account), api_token=crate::apis::urlencode(p_api_token));
3855 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3856
3857 if let Some(ref user_agent) = configuration.user_agent {
3858 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3859 }
3860 if let Some(ref token) = configuration.bearer_access_token {
3861 req_builder = req_builder.bearer_auth(token.to_owned());
3862 };
3863
3864 let req = req_builder.build()?;
3865 let resp = configuration.client.execute(req).await?;
3866
3867 let status = resp.status();
3868 let content_type = resp
3869 .headers()
3870 .get("content-type")
3871 .and_then(|v| v.to_str().ok())
3872 .unwrap_or("application/octet-stream");
3873 let content_type = super::ContentType::from(content_type);
3874
3875 if !status.is_client_error() && !status.is_server_error() {
3876 let content = resp.text().await?;
3877 match content_type {
3878 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3879 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountTokenGetResponse`"))),
3880 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountTokenGetResponse`")))),
3881 }
3882 } else {
3883 let content = resp.text().await?;
3884 let entity: Option<ServiceAccountTokensGetError> = serde_json::from_str(&content).ok();
3885 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3886 }
3887}
3888
3889pub async fn service_account_tokens_list(configuration: &configuration::Configuration, service_account: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ServiceAccountTokensListResponse, Error<ServiceAccountTokensListError>> {
3891 let p_service_account = service_account;
3893 let p_page = page;
3894 let p_per_page = per_page;
3895
3896 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{service_account}/tokens", configuration.base_path, service_account=crate::apis::urlencode(p_service_account));
3897 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3898
3899 if let Some(ref param_value) = p_page {
3900 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
3901 }
3902 if let Some(ref param_value) = p_per_page {
3903 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
3904 }
3905 if let Some(ref user_agent) = configuration.user_agent {
3906 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3907 }
3908 if let Some(ref token) = configuration.bearer_access_token {
3909 req_builder = req_builder.bearer_auth(token.to_owned());
3910 };
3911
3912 let req = req_builder.build()?;
3913 let resp = configuration.client.execute(req).await?;
3914
3915 let status = resp.status();
3916 let content_type = resp
3917 .headers()
3918 .get("content-type")
3919 .and_then(|v| v.to_str().ok())
3920 .unwrap_or("application/octet-stream");
3921 let content_type = super::ContentType::from(content_type);
3922
3923 if !status.is_client_error() && !status.is_server_error() {
3924 let content = resp.text().await?;
3925 match content_type {
3926 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3927 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountTokensListResponse`"))),
3928 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountTokensListResponse`")))),
3929 }
3930 } else {
3931 let content = resp.text().await?;
3932 let entity: Option<ServiceAccountTokensListError> = serde_json::from_str(&content).ok();
3933 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3934 }
3935}
3936
3937pub async fn service_accounts_create(configuration: &configuration::Configuration, update_service_account_request: Option<models::UpdateServiceAccountRequest>) -> Result<models::ServiceAccountGetResponse, Error<ServiceAccountsCreateError>> {
3939 let p_update_service_account_request = update_service_account_request;
3941
3942 let uri_str = format!("{}/v3/workplace/service_accounts", configuration.base_path);
3943 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3944
3945 if let Some(ref user_agent) = configuration.user_agent {
3946 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3947 }
3948 if let Some(ref token) = configuration.bearer_access_token {
3949 req_builder = req_builder.bearer_auth(token.to_owned());
3950 };
3951 req_builder = req_builder.json(&p_update_service_account_request);
3952
3953 let req = req_builder.build()?;
3954 let resp = configuration.client.execute(req).await?;
3955
3956 let status = resp.status();
3957 let content_type = resp
3958 .headers()
3959 .get("content-type")
3960 .and_then(|v| v.to_str().ok())
3961 .unwrap_or("application/octet-stream");
3962 let content_type = super::ContentType::from(content_type);
3963
3964 if !status.is_client_error() && !status.is_server_error() {
3965 let content = resp.text().await?;
3966 match content_type {
3967 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3968 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGetResponse`"))),
3969 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountGetResponse`")))),
3970 }
3971 } else {
3972 let content = resp.text().await?;
3973 let entity: Option<ServiceAccountsCreateError> = serde_json::from_str(&content).ok();
3974 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3975 }
3976}
3977
3978pub async fn service_accounts_delete(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<ServiceAccountsDeleteError>> {
3980 let p_slug = slug;
3982
3983 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
3984 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3985
3986 if let Some(ref user_agent) = configuration.user_agent {
3987 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3988 }
3989 if let Some(ref token) = configuration.bearer_access_token {
3990 req_builder = req_builder.bearer_auth(token.to_owned());
3991 };
3992
3993 let req = req_builder.build()?;
3994 let resp = configuration.client.execute(req).await?;
3995
3996 let status = resp.status();
3997
3998 if !status.is_client_error() && !status.is_server_error() {
3999 Ok(())
4000 } else {
4001 let content = resp.text().await?;
4002 let entity: Option<ServiceAccountsDeleteError> = serde_json::from_str(&content).ok();
4003 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4004 }
4005}
4006
4007pub async fn service_accounts_get(configuration: &configuration::Configuration, slug: &str) -> Result<models::ServiceAccountGetResponse, Error<ServiceAccountsGetError>> {
4009 let p_slug = slug;
4011
4012 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4013 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4014
4015 if let Some(ref user_agent) = configuration.user_agent {
4016 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4017 }
4018 if let Some(ref token) = configuration.bearer_access_token {
4019 req_builder = req_builder.bearer_auth(token.to_owned());
4020 };
4021
4022 let req = req_builder.build()?;
4023 let resp = configuration.client.execute(req).await?;
4024
4025 let status = resp.status();
4026 let content_type = resp
4027 .headers()
4028 .get("content-type")
4029 .and_then(|v| v.to_str().ok())
4030 .unwrap_or("application/octet-stream");
4031 let content_type = super::ContentType::from(content_type);
4032
4033 if !status.is_client_error() && !status.is_server_error() {
4034 let content = resp.text().await?;
4035 match content_type {
4036 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4037 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountGetResponse`"))),
4038 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountGetResponse`")))),
4039 }
4040 } else {
4041 let content = resp.text().await?;
4042 let entity: Option<ServiceAccountsGetError> = serde_json::from_str(&content).ok();
4043 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4044 }
4045}
4046
4047pub async fn service_accounts_list(configuration: &configuration::Configuration, page: Option<i32>, per_page: Option<i32>) -> Result<models::ServiceAccountsListResponse, Error<ServiceAccountsListError>> {
4049 let p_page = page;
4051 let p_per_page = per_page;
4052
4053 let uri_str = format!("{}/v3/workplace/service_accounts", configuration.base_path);
4054 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4055
4056 if let Some(ref param_value) = p_page {
4057 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4058 }
4059 if let Some(ref param_value) = p_per_page {
4060 req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]);
4061 }
4062 if let Some(ref user_agent) = configuration.user_agent {
4063 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4064 }
4065 if let Some(ref token) = configuration.bearer_access_token {
4066 req_builder = req_builder.bearer_auth(token.to_owned());
4067 };
4068
4069 let req = req_builder.build()?;
4070 let resp = configuration.client.execute(req).await?;
4071
4072 let status = resp.status();
4073 let content_type = resp
4074 .headers()
4075 .get("content-type")
4076 .and_then(|v| v.to_str().ok())
4077 .unwrap_or("application/octet-stream");
4078 let content_type = super::ContentType::from(content_type);
4079
4080 if !status.is_client_error() && !status.is_server_error() {
4081 let content = resp.text().await?;
4082 match content_type {
4083 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4084 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountsListResponse`"))),
4085 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountsListResponse`")))),
4086 }
4087 } else {
4088 let content = resp.text().await?;
4089 let entity: Option<ServiceAccountsListError> = serde_json::from_str(&content).ok();
4090 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4091 }
4092}
4093
4094pub async fn service_accounts_update(configuration: &configuration::Configuration, slug: &str, update_service_account_request: Option<models::UpdateServiceAccountRequest>) -> Result<models::ServiceAccountUpdateResponse, Error<ServiceAccountsUpdateError>> {
4096 let p_slug = slug;
4098 let p_update_service_account_request = update_service_account_request;
4099
4100 let uri_str = format!("{}/v3/workplace/service_accounts/service_account/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4101 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4102
4103 if let Some(ref user_agent) = configuration.user_agent {
4104 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4105 }
4106 if let Some(ref token) = configuration.bearer_access_token {
4107 req_builder = req_builder.bearer_auth(token.to_owned());
4108 };
4109 req_builder = req_builder.json(&p_update_service_account_request);
4110
4111 let req = req_builder.build()?;
4112 let resp = configuration.client.execute(req).await?;
4113
4114 let status = resp.status();
4115 let content_type = resp
4116 .headers()
4117 .get("content-type")
4118 .and_then(|v| v.to_str().ok())
4119 .unwrap_or("application/octet-stream");
4120 let content_type = super::ContentType::from(content_type);
4121
4122 if !status.is_client_error() && !status.is_server_error() {
4123 let content = resp.text().await?;
4124 match content_type {
4125 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4126 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceAccountUpdateResponse`"))),
4127 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceAccountUpdateResponse`")))),
4128 }
4129 } else {
4130 let content = resp.text().await?;
4131 let entity: Option<ServiceAccountsUpdateError> = serde_json::from_str(&content).ok();
4132 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4133 }
4134}
4135
4136pub async fn service_tokens_create(configuration: &configuration::Configuration, create_service_token_request: Option<models::CreateServiceTokenRequest>) -> Result<models::ServiceTokenCreateResponse, Error<ServiceTokensCreateError>> {
4138 let p_create_service_token_request = create_service_token_request;
4140
4141 let uri_str = format!("{}/v3/configs/config/tokens", configuration.base_path);
4142 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4143
4144 if let Some(ref user_agent) = configuration.user_agent {
4145 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4146 }
4147 if let Some(ref token) = configuration.bearer_access_token {
4148 req_builder = req_builder.bearer_auth(token.to_owned());
4149 };
4150 req_builder = req_builder.json(&p_create_service_token_request);
4151
4152 let req = req_builder.build()?;
4153 let resp = configuration.client.execute(req).await?;
4154
4155 let status = resp.status();
4156 let content_type = resp
4157 .headers()
4158 .get("content-type")
4159 .and_then(|v| v.to_str().ok())
4160 .unwrap_or("application/octet-stream");
4161 let content_type = super::ContentType::from(content_type);
4162
4163 if !status.is_client_error() && !status.is_server_error() {
4164 let content = resp.text().await?;
4165 match content_type {
4166 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4167 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceTokenCreateResponse`"))),
4168 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceTokenCreateResponse`")))),
4169 }
4170 } else {
4171 let content = resp.text().await?;
4172 let entity: Option<ServiceTokensCreateError> = serde_json::from_str(&content).ok();
4173 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4174 }
4175}
4176
4177pub async fn service_tokens_delete(configuration: &configuration::Configuration, delete_service_token_request: Option<models::DeleteServiceTokenRequest>) -> Result<models::ConfigDeleteResponse, Error<ServiceTokensDeleteError>> {
4179 let p_delete_service_token_request = delete_service_token_request;
4181
4182 let uri_str = format!("{}/v3/configs/config/tokens/token", configuration.base_path);
4183 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4184
4185 if let Some(ref user_agent) = configuration.user_agent {
4186 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4187 }
4188 if let Some(ref token) = configuration.bearer_access_token {
4189 req_builder = req_builder.bearer_auth(token.to_owned());
4190 };
4191 req_builder = req_builder.json(&p_delete_service_token_request);
4192
4193 let req = req_builder.build()?;
4194 let resp = configuration.client.execute(req).await?;
4195
4196 let status = resp.status();
4197 let content_type = resp
4198 .headers()
4199 .get("content-type")
4200 .and_then(|v| v.to_str().ok())
4201 .unwrap_or("application/octet-stream");
4202 let content_type = super::ContentType::from(content_type);
4203
4204 if !status.is_client_error() && !status.is_server_error() {
4205 let content = resp.text().await?;
4206 match content_type {
4207 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4208 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ConfigDeleteResponse`"))),
4209 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ConfigDeleteResponse`")))),
4210 }
4211 } else {
4212 let content = resp.text().await?;
4213 let entity: Option<ServiceTokensDeleteError> = serde_json::from_str(&content).ok();
4214 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4215 }
4216}
4217
4218pub async fn service_tokens_list(configuration: &configuration::Configuration, project: &str, config: &str) -> Result<models::ServiceTokensListResponse, Error<ServiceTokensListError>> {
4220 let p_project = project;
4222 let p_config = config;
4223
4224 let uri_str = format!("{}/v3/configs/config/tokens", configuration.base_path);
4225 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4226
4227 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
4228 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
4229 if let Some(ref user_agent) = configuration.user_agent {
4230 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4231 }
4232 if let Some(ref token) = configuration.bearer_access_token {
4233 req_builder = req_builder.bearer_auth(token.to_owned());
4234 };
4235
4236 let req = req_builder.build()?;
4237 let resp = configuration.client.execute(req).await?;
4238
4239 let status = resp.status();
4240 let content_type = resp
4241 .headers()
4242 .get("content-type")
4243 .and_then(|v| v.to_str().ok())
4244 .unwrap_or("application/octet-stream");
4245 let content_type = super::ContentType::from(content_type);
4246
4247 if !status.is_client_error() && !status.is_server_error() {
4248 let content = resp.text().await?;
4249 match content_type {
4250 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4251 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceTokensListResponse`"))),
4252 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServiceTokensListResponse`")))),
4253 }
4254 } else {
4255 let content = resp.text().await?;
4256 let entity: Option<ServiceTokensListError> = serde_json::from_str(&content).ok();
4257 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4258 }
4259}
4260
4261pub async fn syncs_create(configuration: &configuration::Configuration, project: &str, config: &str, create_sync_request: Option<models::CreateSyncRequest>) -> Result<models::SyncCreateResponse, Error<SyncsCreateError>> {
4263 let p_project = project;
4265 let p_config = config;
4266 let p_create_sync_request = create_sync_request;
4267
4268 let uri_str = format!("{}/v3/configs/config/syncs", configuration.base_path);
4269 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4270
4271 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
4272 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
4273 if let Some(ref user_agent) = configuration.user_agent {
4274 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4275 }
4276 if let Some(ref token) = configuration.bearer_access_token {
4277 req_builder = req_builder.bearer_auth(token.to_owned());
4278 };
4279 req_builder = req_builder.json(&p_create_sync_request);
4280
4281 let req = req_builder.build()?;
4282 let resp = configuration.client.execute(req).await?;
4283
4284 let status = resp.status();
4285 let content_type = resp
4286 .headers()
4287 .get("content-type")
4288 .and_then(|v| v.to_str().ok())
4289 .unwrap_or("application/octet-stream");
4290 let content_type = super::ContentType::from(content_type);
4291
4292 if !status.is_client_error() && !status.is_server_error() {
4293 let content = resp.text().await?;
4294 match content_type {
4295 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4296 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncCreateResponse`"))),
4297 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncCreateResponse`")))),
4298 }
4299 } else {
4300 let content = resp.text().await?;
4301 let entity: Option<SyncsCreateError> = serde_json::from_str(&content).ok();
4302 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4303 }
4304}
4305
4306pub async fn syncs_delete(configuration: &configuration::Configuration, project: &str, config: &str, sync: &str, delete_from_target: bool) -> Result<serde_json::Value, Error<SyncsDeleteError>> {
4308 let p_project = project;
4310 let p_config = config;
4311 let p_sync = sync;
4312 let p_delete_from_target = delete_from_target;
4313
4314 let uri_str = format!("{}/v3/configs/config/syncs/sync", configuration.base_path);
4315 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4316
4317 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
4318 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
4319 req_builder = req_builder.query(&[("sync", &p_sync.to_string())]);
4320 req_builder = req_builder.query(&[("delete_from_target", &p_delete_from_target.to_string())]);
4321 if let Some(ref user_agent) = configuration.user_agent {
4322 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4323 }
4324 if let Some(ref token) = configuration.bearer_access_token {
4325 req_builder = req_builder.bearer_auth(token.to_owned());
4326 };
4327
4328 let req = req_builder.build()?;
4329 let resp = configuration.client.execute(req).await?;
4330
4331 let status = resp.status();
4332 let content_type = resp
4333 .headers()
4334 .get("content-type")
4335 .and_then(|v| v.to_str().ok())
4336 .unwrap_or("application/octet-stream");
4337 let content_type = super::ContentType::from(content_type);
4338
4339 if !status.is_client_error() && !status.is_server_error() {
4340 let content = resp.text().await?;
4341 match content_type {
4342 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4343 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4344 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4345 }
4346 } else {
4347 let content = resp.text().await?;
4348 let entity: Option<SyncsDeleteError> = serde_json::from_str(&content).ok();
4349 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4350 }
4351}
4352
4353pub async fn syncs_get(configuration: &configuration::Configuration, project: &str, config: &str, sync: &str) -> Result<models::SyncCreateResponse, Error<SyncsGetError>> {
4355 let p_project = project;
4357 let p_config = config;
4358 let p_sync = sync;
4359
4360 let uri_str = format!("{}/v3/configs/config/syncs/sync", configuration.base_path);
4361 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4362
4363 req_builder = req_builder.query(&[("project", &p_project.to_string())]);
4364 req_builder = req_builder.query(&[("config", &p_config.to_string())]);
4365 req_builder = req_builder.query(&[("sync", &p_sync.to_string())]);
4366 if let Some(ref user_agent) = configuration.user_agent {
4367 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4368 }
4369 if let Some(ref token) = configuration.bearer_access_token {
4370 req_builder = req_builder.bearer_auth(token.to_owned());
4371 };
4372
4373 let req = req_builder.build()?;
4374 let resp = configuration.client.execute(req).await?;
4375
4376 let status = resp.status();
4377 let content_type = resp
4378 .headers()
4379 .get("content-type")
4380 .and_then(|v| v.to_str().ok())
4381 .unwrap_or("application/octet-stream");
4382 let content_type = super::ContentType::from(content_type);
4383
4384 if !status.is_client_error() && !status.is_server_error() {
4385 let content = resp.text().await?;
4386 match content_type {
4387 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4388 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncCreateResponse`"))),
4389 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncCreateResponse`")))),
4390 }
4391 } else {
4392 let content = resp.text().await?;
4393 let entity: Option<SyncsGetError> = serde_json::from_str(&content).ok();
4394 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4395 }
4396}
4397
4398pub async fn users_get(configuration: &configuration::Configuration, slug: &str) -> Result<models::UserGetResponse, Error<UsersGetError>> {
4400 let p_slug = slug;
4402
4403 let uri_str = format!("{}/v3/workplace/users/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4404 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4405
4406 if let Some(ref user_agent) = configuration.user_agent {
4407 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4408 }
4409 if let Some(ref token) = configuration.bearer_access_token {
4410 req_builder = req_builder.bearer_auth(token.to_owned());
4411 };
4412
4413 let req = req_builder.build()?;
4414 let resp = configuration.client.execute(req).await?;
4415
4416 let status = resp.status();
4417 let content_type = resp
4418 .headers()
4419 .get("content-type")
4420 .and_then(|v| v.to_str().ok())
4421 .unwrap_or("application/octet-stream");
4422 let content_type = super::ContentType::from(content_type);
4423
4424 if !status.is_client_error() && !status.is_server_error() {
4425 let content = resp.text().await?;
4426 match content_type {
4427 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4428 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserGetResponse`"))),
4429 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserGetResponse`")))),
4430 }
4431 } else {
4432 let content = resp.text().await?;
4433 let entity: Option<UsersGetError> = serde_json::from_str(&content).ok();
4434 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4435 }
4436}
4437
4438pub async fn users_list(configuration: &configuration::Configuration, page: Option<i32>, email: Option<&str>) -> Result<models::UsersListResponse, Error<UsersListError>> {
4440 let p_page = page;
4442 let p_email = email;
4443
4444 let uri_str = format!("{}/v3/workplace/users", configuration.base_path);
4445 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4446
4447 if let Some(ref param_value) = p_page {
4448 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
4449 }
4450 if let Some(ref param_value) = p_email {
4451 req_builder = req_builder.query(&[("email", ¶m_value.to_string())]);
4452 }
4453 if let Some(ref user_agent) = configuration.user_agent {
4454 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4455 }
4456 if let Some(ref token) = configuration.bearer_access_token {
4457 req_builder = req_builder.bearer_auth(token.to_owned());
4458 };
4459
4460 let req = req_builder.build()?;
4461 let resp = configuration.client.execute(req).await?;
4462
4463 let status = resp.status();
4464 let content_type = resp
4465 .headers()
4466 .get("content-type")
4467 .and_then(|v| v.to_str().ok())
4468 .unwrap_or("application/octet-stream");
4469 let content_type = super::ContentType::from(content_type);
4470
4471 if !status.is_client_error() && !status.is_server_error() {
4472 let content = resp.text().await?;
4473 match content_type {
4474 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4475 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UsersListResponse`"))),
4476 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UsersListResponse`")))),
4477 }
4478 } else {
4479 let content = resp.text().await?;
4480 let entity: Option<UsersListError> = serde_json::from_str(&content).ok();
4481 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4482 }
4483}
4484
4485pub async fn users_update(configuration: &configuration::Configuration, slug: &str, update_user_request: Option<models::UpdateUserRequest>) -> Result<models::UserGetResponse, Error<UsersUpdateError>> {
4487 let p_slug = slug;
4489 let p_update_user_request = update_user_request;
4490
4491 let uri_str = format!("{}/v3/workplace/users/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4492 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4493
4494 if let Some(ref user_agent) = configuration.user_agent {
4495 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4496 }
4497 if let Some(ref token) = configuration.bearer_access_token {
4498 req_builder = req_builder.bearer_auth(token.to_owned());
4499 };
4500 req_builder = req_builder.json(&p_update_user_request);
4501
4502 let req = req_builder.build()?;
4503 let resp = configuration.client.execute(req).await?;
4504
4505 let status = resp.status();
4506 let content_type = resp
4507 .headers()
4508 .get("content-type")
4509 .and_then(|v| v.to_str().ok())
4510 .unwrap_or("application/octet-stream");
4511 let content_type = super::ContentType::from(content_type);
4512
4513 if !status.is_client_error() && !status.is_server_error() {
4514 let content = resp.text().await?;
4515 match content_type {
4516 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4517 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserGetResponse`"))),
4518 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserGetResponse`")))),
4519 }
4520 } else {
4521 let content = resp.text().await?;
4522 let entity: Option<UsersUpdateError> = serde_json::from_str(&content).ok();
4523 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4524 }
4525}
4526
4527pub async fn webhooks_add(configuration: &configuration::Configuration, project: Option<&str>, create_webhook_request: Option<models::CreateWebhookRequest>) -> Result<serde_json::Value, Error<WebhooksAddError>> {
4529 let p_project = project;
4531 let p_create_webhook_request = create_webhook_request;
4532
4533 let uri_str = format!("{}/v3/webhooks", configuration.base_path);
4534 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4535
4536 if let Some(ref param_value) = p_project {
4537 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4538 }
4539 if let Some(ref user_agent) = configuration.user_agent {
4540 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4541 }
4542 if let Some(ref token) = configuration.bearer_access_token {
4543 req_builder = req_builder.bearer_auth(token.to_owned());
4544 };
4545 req_builder = req_builder.json(&p_create_webhook_request);
4546
4547 let req = req_builder.build()?;
4548 let resp = configuration.client.execute(req).await?;
4549
4550 let status = resp.status();
4551 let content_type = resp
4552 .headers()
4553 .get("content-type")
4554 .and_then(|v| v.to_str().ok())
4555 .unwrap_or("application/octet-stream");
4556 let content_type = super::ContentType::from(content_type);
4557
4558 if !status.is_client_error() && !status.is_server_error() {
4559 let content = resp.text().await?;
4560 match content_type {
4561 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4562 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4563 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4564 }
4565 } else {
4566 let content = resp.text().await?;
4567 let entity: Option<WebhooksAddError> = serde_json::from_str(&content).ok();
4568 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4569 }
4570}
4571
4572pub async fn webhooks_delete(configuration: &configuration::Configuration, slug: &str, project: Option<&str>) -> Result<serde_json::Value, Error<WebhooksDeleteError>> {
4574 let p_slug = slug;
4576 let p_project = project;
4577
4578 let uri_str = format!("{}/v3/webhooks/webhook/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4579 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4580
4581 if let Some(ref param_value) = p_project {
4582 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4583 }
4584 if let Some(ref user_agent) = configuration.user_agent {
4585 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4586 }
4587 if let Some(ref token) = configuration.bearer_access_token {
4588 req_builder = req_builder.bearer_auth(token.to_owned());
4589 };
4590
4591 let req = req_builder.build()?;
4592 let resp = configuration.client.execute(req).await?;
4593
4594 let status = resp.status();
4595 let content_type = resp
4596 .headers()
4597 .get("content-type")
4598 .and_then(|v| v.to_str().ok())
4599 .unwrap_or("application/octet-stream");
4600 let content_type = super::ContentType::from(content_type);
4601
4602 if !status.is_client_error() && !status.is_server_error() {
4603 let content = resp.text().await?;
4604 match content_type {
4605 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4606 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4607 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4608 }
4609 } else {
4610 let content = resp.text().await?;
4611 let entity: Option<WebhooksDeleteError> = serde_json::from_str(&content).ok();
4612 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4613 }
4614}
4615
4616pub async fn webhooks_disable(configuration: &configuration::Configuration, slug: &str, project: Option<&str>) -> Result<serde_json::Value, Error<WebhooksDisableError>> {
4618 let p_slug = slug;
4620 let p_project = project;
4621
4622 let uri_str = format!("{}/v3/webhooks/webhook/{slug}/disable", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4623 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4624
4625 if let Some(ref param_value) = p_project {
4626 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4627 }
4628 if let Some(ref user_agent) = configuration.user_agent {
4629 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4630 }
4631 if let Some(ref token) = configuration.bearer_access_token {
4632 req_builder = req_builder.bearer_auth(token.to_owned());
4633 };
4634
4635 let req = req_builder.build()?;
4636 let resp = configuration.client.execute(req).await?;
4637
4638 let status = resp.status();
4639 let content_type = resp
4640 .headers()
4641 .get("content-type")
4642 .and_then(|v| v.to_str().ok())
4643 .unwrap_or("application/octet-stream");
4644 let content_type = super::ContentType::from(content_type);
4645
4646 if !status.is_client_error() && !status.is_server_error() {
4647 let content = resp.text().await?;
4648 match content_type {
4649 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4650 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4651 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4652 }
4653 } else {
4654 let content = resp.text().await?;
4655 let entity: Option<WebhooksDisableError> = serde_json::from_str(&content).ok();
4656 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4657 }
4658}
4659
4660pub async fn webhooks_enable(configuration: &configuration::Configuration, slug: &str, project: Option<&str>) -> Result<serde_json::Value, Error<WebhooksEnableError>> {
4662 let p_slug = slug;
4664 let p_project = project;
4665
4666 let uri_str = format!("{}/v3/webhooks/webhook/{slug}/enable", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4667 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4668
4669 if let Some(ref param_value) = p_project {
4670 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4671 }
4672 if let Some(ref user_agent) = configuration.user_agent {
4673 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4674 }
4675 if let Some(ref token) = configuration.bearer_access_token {
4676 req_builder = req_builder.bearer_auth(token.to_owned());
4677 };
4678
4679 let req = req_builder.build()?;
4680 let resp = configuration.client.execute(req).await?;
4681
4682 let status = resp.status();
4683 let content_type = resp
4684 .headers()
4685 .get("content-type")
4686 .and_then(|v| v.to_str().ok())
4687 .unwrap_or("application/octet-stream");
4688 let content_type = super::ContentType::from(content_type);
4689
4690 if !status.is_client_error() && !status.is_server_error() {
4691 let content = resp.text().await?;
4692 match content_type {
4693 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4694 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4695 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4696 }
4697 } else {
4698 let content = resp.text().await?;
4699 let entity: Option<WebhooksEnableError> = serde_json::from_str(&content).ok();
4700 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4701 }
4702}
4703
4704pub async fn webhooks_get(configuration: &configuration::Configuration, slug: &str, project: Option<&str>) -> Result<serde_json::Value, Error<WebhooksGetError>> {
4706 let p_slug = slug;
4708 let p_project = project;
4709
4710 let uri_str = format!("{}/v3/webhooks/webhook/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4711 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4712
4713 if let Some(ref param_value) = p_project {
4714 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4715 }
4716 if let Some(ref user_agent) = configuration.user_agent {
4717 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4718 }
4719 if let Some(ref token) = configuration.bearer_access_token {
4720 req_builder = req_builder.bearer_auth(token.to_owned());
4721 };
4722
4723 let req = req_builder.build()?;
4724 let resp = configuration.client.execute(req).await?;
4725
4726 let status = resp.status();
4727 let content_type = resp
4728 .headers()
4729 .get("content-type")
4730 .and_then(|v| v.to_str().ok())
4731 .unwrap_or("application/octet-stream");
4732 let content_type = super::ContentType::from(content_type);
4733
4734 if !status.is_client_error() && !status.is_server_error() {
4735 let content = resp.text().await?;
4736 match content_type {
4737 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4738 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4739 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4740 }
4741 } else {
4742 let content = resp.text().await?;
4743 let entity: Option<WebhooksGetError> = serde_json::from_str(&content).ok();
4744 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4745 }
4746}
4747
4748pub async fn webhooks_list(configuration: &configuration::Configuration, project: Option<&str>) -> Result<serde_json::Value, Error<WebhooksListError>> {
4750 let p_project = project;
4752
4753 let uri_str = format!("{}/v3/webhooks", configuration.base_path);
4754 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4755
4756 if let Some(ref param_value) = p_project {
4757 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4758 }
4759 if let Some(ref user_agent) = configuration.user_agent {
4760 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4761 }
4762 if let Some(ref token) = configuration.bearer_access_token {
4763 req_builder = req_builder.bearer_auth(token.to_owned());
4764 };
4765
4766 let req = req_builder.build()?;
4767 let resp = configuration.client.execute(req).await?;
4768
4769 let status = resp.status();
4770 let content_type = resp
4771 .headers()
4772 .get("content-type")
4773 .and_then(|v| v.to_str().ok())
4774 .unwrap_or("application/octet-stream");
4775 let content_type = super::ContentType::from(content_type);
4776
4777 if !status.is_client_error() && !status.is_server_error() {
4778 let content = resp.text().await?;
4779 match content_type {
4780 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4781 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4782 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4783 }
4784 } else {
4785 let content = resp.text().await?;
4786 let entity: Option<WebhooksListError> = serde_json::from_str(&content).ok();
4787 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4788 }
4789}
4790
4791pub async fn webhooks_update(configuration: &configuration::Configuration, slug: &str, project: Option<&str>, update_webhook_request: Option<models::UpdateWebhookRequest>) -> Result<serde_json::Value, Error<WebhooksUpdateError>> {
4793 let p_slug = slug;
4795 let p_project = project;
4796 let p_update_webhook_request = update_webhook_request;
4797
4798 let uri_str = format!("{}/v3/webhooks/webhook/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
4799 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4800
4801 if let Some(ref param_value) = p_project {
4802 req_builder = req_builder.query(&[("project", ¶m_value.to_string())]);
4803 }
4804 if let Some(ref user_agent) = configuration.user_agent {
4805 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4806 }
4807 if let Some(ref token) = configuration.bearer_access_token {
4808 req_builder = req_builder.bearer_auth(token.to_owned());
4809 };
4810 req_builder = req_builder.json(&p_update_webhook_request);
4811
4812 let req = req_builder.build()?;
4813 let resp = configuration.client.execute(req).await?;
4814
4815 let status = resp.status();
4816 let content_type = resp
4817 .headers()
4818 .get("content-type")
4819 .and_then(|v| v.to_str().ok())
4820 .unwrap_or("application/octet-stream");
4821 let content_type = super::ContentType::from(content_type);
4822
4823 if !status.is_client_error() && !status.is_server_error() {
4824 let content = resp.text().await?;
4825 match content_type {
4826 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4827 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
4828 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
4829 }
4830 } else {
4831 let content = resp.text().await?;
4832 let entity: Option<WebhooksUpdateError> = serde_json::from_str(&content).ok();
4833 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4834 }
4835}
4836
4837pub async fn workplace_get(configuration: &configuration::Configuration, ) -> Result<models::WorkplaceGetResponse, Error<WorkplaceGetError>> {
4839
4840 let uri_str = format!("{}/v3/workplace", configuration.base_path);
4841 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4842
4843 if let Some(ref user_agent) = configuration.user_agent {
4844 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4845 }
4846 if let Some(ref token) = configuration.bearer_access_token {
4847 req_builder = req_builder.bearer_auth(token.to_owned());
4848 };
4849
4850 let req = req_builder.build()?;
4851 let resp = configuration.client.execute(req).await?;
4852
4853 let status = resp.status();
4854 let content_type = resp
4855 .headers()
4856 .get("content-type")
4857 .and_then(|v| v.to_str().ok())
4858 .unwrap_or("application/octet-stream");
4859 let content_type = super::ContentType::from(content_type);
4860
4861 if !status.is_client_error() && !status.is_server_error() {
4862 let content = resp.text().await?;
4863 match content_type {
4864 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4865 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceGetResponse`"))),
4866 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceGetResponse`")))),
4867 }
4868 } else {
4869 let content = resp.text().await?;
4870 let entity: Option<WorkplaceGetError> = serde_json::from_str(&content).ok();
4871 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4872 }
4873}
4874
4875pub async fn workplace_roles_create(configuration: &configuration::Configuration, create_workplace_role_request: Option<models::CreateWorkplaceRoleRequest>) -> Result<models::WorkplaceRoleCreateResponse, Error<WorkplaceRolesCreateError>> {
4877 let p_create_workplace_role_request = create_workplace_role_request;
4879
4880 let uri_str = format!("{}/v3/workplace/roles", configuration.base_path);
4881 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4882
4883 if let Some(ref user_agent) = configuration.user_agent {
4884 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4885 }
4886 if let Some(ref token) = configuration.bearer_access_token {
4887 req_builder = req_builder.bearer_auth(token.to_owned());
4888 };
4889 req_builder = req_builder.json(&p_create_workplace_role_request);
4890
4891 let req = req_builder.build()?;
4892 let resp = configuration.client.execute(req).await?;
4893
4894 let status = resp.status();
4895 let content_type = resp
4896 .headers()
4897 .get("content-type")
4898 .and_then(|v| v.to_str().ok())
4899 .unwrap_or("application/octet-stream");
4900 let content_type = super::ContentType::from(content_type);
4901
4902 if !status.is_client_error() && !status.is_server_error() {
4903 let content = resp.text().await?;
4904 match content_type {
4905 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4906 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceRoleCreateResponse`"))),
4907 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceRoleCreateResponse`")))),
4908 }
4909 } else {
4910 let content = resp.text().await?;
4911 let entity: Option<WorkplaceRolesCreateError> = serde_json::from_str(&content).ok();
4912 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4913 }
4914}
4915
4916pub async fn workplace_roles_delete(configuration: &configuration::Configuration, role: &str) -> Result<(), Error<WorkplaceRolesDeleteError>> {
4918 let p_role = role;
4920
4921 let uri_str = format!("{}/v3/workplace/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
4922 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4923
4924 if let Some(ref user_agent) = configuration.user_agent {
4925 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4926 }
4927 if let Some(ref token) = configuration.bearer_access_token {
4928 req_builder = req_builder.bearer_auth(token.to_owned());
4929 };
4930
4931 let req = req_builder.build()?;
4932 let resp = configuration.client.execute(req).await?;
4933
4934 let status = resp.status();
4935
4936 if !status.is_client_error() && !status.is_server_error() {
4937 Ok(())
4938 } else {
4939 let content = resp.text().await?;
4940 let entity: Option<WorkplaceRolesDeleteError> = serde_json::from_str(&content).ok();
4941 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4942 }
4943}
4944
4945pub async fn workplace_roles_get(configuration: &configuration::Configuration, role: &str) -> Result<models::WorkplaceRoleGetResponse, Error<WorkplaceRolesGetError>> {
4947 let p_role = role;
4949
4950 let uri_str = format!("{}/v3/workplace/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
4951 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4952
4953 if let Some(ref user_agent) = configuration.user_agent {
4954 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4955 }
4956 if let Some(ref token) = configuration.bearer_access_token {
4957 req_builder = req_builder.bearer_auth(token.to_owned());
4958 };
4959
4960 let req = req_builder.build()?;
4961 let resp = configuration.client.execute(req).await?;
4962
4963 let status = resp.status();
4964 let content_type = resp
4965 .headers()
4966 .get("content-type")
4967 .and_then(|v| v.to_str().ok())
4968 .unwrap_or("application/octet-stream");
4969 let content_type = super::ContentType::from(content_type);
4970
4971 if !status.is_client_error() && !status.is_server_error() {
4972 let content = resp.text().await?;
4973 match content_type {
4974 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4975 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceRoleGetResponse`"))),
4976 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceRoleGetResponse`")))),
4977 }
4978 } else {
4979 let content = resp.text().await?;
4980 let entity: Option<WorkplaceRolesGetError> = serde_json::from_str(&content).ok();
4981 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4982 }
4983}
4984
4985pub async fn workplace_roles_list(configuration: &configuration::Configuration, ) -> Result<models::WorkplaceRolesListResponse, Error<WorkplaceRolesListError>> {
4987
4988 let uri_str = format!("{}/v3/workplace/roles", configuration.base_path);
4989 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4990
4991 if let Some(ref user_agent) = configuration.user_agent {
4992 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4993 }
4994 if let Some(ref token) = configuration.bearer_access_token {
4995 req_builder = req_builder.bearer_auth(token.to_owned());
4996 };
4997
4998 let req = req_builder.build()?;
4999 let resp = configuration.client.execute(req).await?;
5000
5001 let status = resp.status();
5002 let content_type = resp
5003 .headers()
5004 .get("content-type")
5005 .and_then(|v| v.to_str().ok())
5006 .unwrap_or("application/octet-stream");
5007 let content_type = super::ContentType::from(content_type);
5008
5009 if !status.is_client_error() && !status.is_server_error() {
5010 let content = resp.text().await?;
5011 match content_type {
5012 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5013 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceRolesListResponse`"))),
5014 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceRolesListResponse`")))),
5015 }
5016 } else {
5017 let content = resp.text().await?;
5018 let entity: Option<WorkplaceRolesListError> = serde_json::from_str(&content).ok();
5019 Err(Error::ResponseError(ResponseContent { status, content, entity }))
5020 }
5021}
5022
5023pub async fn workplace_roles_list_permissions(configuration: &configuration::Configuration, ) -> Result<models::WorkplacePermissionsResponse, Error<WorkplaceRolesListPermissionsError>> {
5025
5026 let uri_str = format!("{}/v3/workplace/permissions", configuration.base_path);
5027 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5028
5029 if let Some(ref user_agent) = configuration.user_agent {
5030 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5031 }
5032 if let Some(ref token) = configuration.bearer_access_token {
5033 req_builder = req_builder.bearer_auth(token.to_owned());
5034 };
5035
5036 let req = req_builder.build()?;
5037 let resp = configuration.client.execute(req).await?;
5038
5039 let status = resp.status();
5040 let content_type = resp
5041 .headers()
5042 .get("content-type")
5043 .and_then(|v| v.to_str().ok())
5044 .unwrap_or("application/octet-stream");
5045 let content_type = super::ContentType::from(content_type);
5046
5047 if !status.is_client_error() && !status.is_server_error() {
5048 let content = resp.text().await?;
5049 match content_type {
5050 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5051 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplacePermissionsResponse`"))),
5052 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplacePermissionsResponse`")))),
5053 }
5054 } else {
5055 let content = resp.text().await?;
5056 let entity: Option<WorkplaceRolesListPermissionsError> = serde_json::from_str(&content).ok();
5057 Err(Error::ResponseError(ResponseContent { status, content, entity }))
5058 }
5059}
5060
5061pub async fn workplace_roles_update(configuration: &configuration::Configuration, role: &str, update_workplace_role_request: Option<models::UpdateWorkplaceRoleRequest>) -> Result<models::WorkplaceRoleCreateResponse, Error<WorkplaceRolesUpdateError>> {
5063 let p_role = role;
5065 let p_update_workplace_role_request = update_workplace_role_request;
5066
5067 let uri_str = format!("{}/v3/workplace/roles/role/{role}", configuration.base_path, role=crate::apis::urlencode(p_role));
5068 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5069
5070 if let Some(ref user_agent) = configuration.user_agent {
5071 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5072 }
5073 if let Some(ref token) = configuration.bearer_access_token {
5074 req_builder = req_builder.bearer_auth(token.to_owned());
5075 };
5076 req_builder = req_builder.json(&p_update_workplace_role_request);
5077
5078 let req = req_builder.build()?;
5079 let resp = configuration.client.execute(req).await?;
5080
5081 let status = resp.status();
5082 let content_type = resp
5083 .headers()
5084 .get("content-type")
5085 .and_then(|v| v.to_str().ok())
5086 .unwrap_or("application/octet-stream");
5087 let content_type = super::ContentType::from(content_type);
5088
5089 if !status.is_client_error() && !status.is_server_error() {
5090 let content = resp.text().await?;
5091 match content_type {
5092 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5093 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceRoleCreateResponse`"))),
5094 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceRoleCreateResponse`")))),
5095 }
5096 } else {
5097 let content = resp.text().await?;
5098 let entity: Option<WorkplaceRolesUpdateError> = serde_json::from_str(&content).ok();
5099 Err(Error::ResponseError(ResponseContent { status, content, entity }))
5100 }
5101}
5102
5103pub async fn workplace_update(configuration: &configuration::Configuration, update_workplace_request: Option<models::UpdateWorkplaceRequest>) -> Result<models::WorkplaceGetResponse, Error<WorkplaceUpdateError>> {
5105 let p_update_workplace_request = update_workplace_request;
5107
5108 let uri_str = format!("{}/v3/workplace", configuration.base_path);
5109 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5110
5111 if let Some(ref user_agent) = configuration.user_agent {
5112 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5113 }
5114 if let Some(ref token) = configuration.bearer_access_token {
5115 req_builder = req_builder.bearer_auth(token.to_owned());
5116 };
5117 req_builder = req_builder.json(&p_update_workplace_request);
5118
5119 let req = req_builder.build()?;
5120 let resp = configuration.client.execute(req).await?;
5121
5122 let status = resp.status();
5123 let content_type = resp
5124 .headers()
5125 .get("content-type")
5126 .and_then(|v| v.to_str().ok())
5127 .unwrap_or("application/octet-stream");
5128 let content_type = super::ContentType::from(content_type);
5129
5130 if !status.is_client_error() && !status.is_server_error() {
5131 let content = resp.text().await?;
5132 match content_type {
5133 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5134 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WorkplaceGetResponse`"))),
5135 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WorkplaceGetResponse`")))),
5136 }
5137 } else {
5138 let content = resp.text().await?;
5139 let entity: Option<WorkplaceUpdateError> = serde_json::from_str(&content).ok();
5140 Err(Error::ResponseError(ResponseContent { status, content, entity }))
5141 }
5142}
5143