ephemeris_forge_forgejo/api/operations/
access.rs1use ephemeris_forge::{RepoRef, TeamName, UserName};
2
3use crate::Permission;
4use crate::api::error::ForgeError;
5use crate::api::model::{Collaborator, Team};
6
7pub trait AccessApi {
9 fn add_collaborator(
11 &self,
12 repo: &RepoRef,
13 user: &UserName,
14 permission: Permission,
15 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
16
17 fn add_team(
19 &self,
20 repo: &RepoRef,
21 team: &TeamName,
22 permission: Permission,
23 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
24
25 fn collaborators(
29 &self,
30 repo: &RepoRef,
31 ) -> impl Future<Output = Result<Vec<Collaborator>, ForgeError>> + Send;
32
33 fn current_user(&self) -> impl Future<Output = Result<String, ForgeError>> + Send;
35
36 fn organization_teams(
38 &self,
39 organization: &str,
40 ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
41
42 fn remove_collaborator(
44 &self,
45 repo: &RepoRef,
46 user: &str,
47 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
48
49 fn remove_team(
51 &self,
52 repo: &RepoRef,
53 team: &str,
54 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
55
56 fn teams(&self, repo: &RepoRef) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
58
59 fn user_teams(&self) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
61}