Skip to main content

AccessApi

Trait AccessApi 

Source
pub trait AccessApi {
    // Required methods
    fn add_collaborator(
        &self,
        repo: &RepoRef,
        user: &UserName,
        permission: Permission,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn add_team(
        &self,
        repo: &RepoRef,
        team: &TeamName,
        permission: Permission,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn collaborators(
        &self,
        repo: &RepoRef,
    ) -> impl Future<Output = Result<Vec<Collaborator>, ForgeError>> + Send;
    fn current_user(
        &self,
    ) -> impl Future<Output = Result<String, ForgeError>> + Send;
    fn organization_teams(
        &self,
        organization: &str,
    ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
    fn remove_collaborator(
        &self,
        repo: &RepoRef,
        user: &str,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn remove_team(
        &self,
        repo: &RepoRef,
        team: &str,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn teams(
        &self,
        repo: &RepoRef,
    ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
    fn user_teams(
        &self,
    ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send;
}
Expand description

The access operations of the Forgejo API.

Required Methods§

Source

fn add_collaborator( &self, repo: &RepoRef, user: &UserName, permission: Permission, ) -> impl Future<Output = Result<(), ForgeError>> + Send

PUT /repos/{owner}/{repo}/collaborators/{collaborator}.

Source

fn add_team( &self, repo: &RepoRef, team: &TeamName, permission: Permission, ) -> impl Future<Output = Result<(), ForgeError>> + Send

PUT /repos/{owner}/{repo}/teams/{team}.

Source

fn collaborators( &self, repo: &RepoRef, ) -> impl Future<Output = Result<Vec<Collaborator>, ForgeError>> + Send

GET /repos/{owner}/{repo}/collaborators, every page, then GET /repos/{owner}/{repo}/collaborators/{collaborator}/permission for each user.

Source

fn current_user( &self, ) -> impl Future<Output = Result<String, ForgeError>> + Send

GET /user, the login of the authenticated user.

Source

fn organization_teams( &self, organization: &str, ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send

GET /orgs/{org}/teams, every page.

Source

fn remove_collaborator( &self, repo: &RepoRef, user: &str, ) -> impl Future<Output = Result<(), ForgeError>> + Send

DELETE /repos/{owner}/{repo}/collaborators/{collaborator}.

Source

fn remove_team( &self, repo: &RepoRef, team: &str, ) -> impl Future<Output = Result<(), ForgeError>> + Send

DELETE /repos/{owner}/{repo}/teams/{team}.

Source

fn teams( &self, repo: &RepoRef, ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send

GET /repos/{owner}/{repo}/teams.

Source

fn user_teams( &self, ) -> impl Future<Output = Result<Vec<Team>, ForgeError>> + Send

GET /user/teams, every page.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§