Struct gitlab::Gitlab
[−]
[src]
pub struct Gitlab { /* fields omitted */ }
A representation of the Gitlab API for a single user.
Separate users should use separate instances of this.
Methods
impl Gitlab
[src]
fn new<T: ToString>(host: &str, token: T) -> Result<Self>
Create a new Gitlab API representation.
Errors out if token
is invalid.
fn new_insecure<T: ToString>(host: &str, token: T) -> Result<Self>
Create a new non-SSL Gitlab API representation.
Errors out if token
is invalid.
fn current_user(&self) -> Result<UserPublic>
The user the API is acting as.
fn users<T: UserResult>(&self) -> Result<Vec<T>>
Get all user accounts
fn user<T: UserResult>(&self, user: UserId) -> Result<T>
Find a user by id.
fn user_by_name<T: UserResult>(&self, name: &str) -> Result<T>
Find a user by username.
fn projects(&self) -> Result<Vec<Project>>
Get all accessible projects.
fn owned_projects(&self) -> Result<Vec<Project>>
Get all owned projects.
fn all_projects(&self) -> Result<Vec<Project>>
Get all projects.
Requires administrator privileges.
fn project(&self, project: ProjectId) -> Result<Project>
Find a project by id.
fn project_by_name(&self, name: &str) -> Result<Project>
Find a project by name.
fn hooks(&self, project: ProjectId) -> Result<Vec<Hook>>
Get a project's hooks.
fn hook(&self, project: ProjectId, hook: HookId) -> Result<Hook>
Get a project hook.
fn add_hook(&self,
project: ProjectId,
url: &str,
events: WebhookEvents)
-> Result<Hook>
project: ProjectId,
url: &str,
events: WebhookEvents)
-> Result<Hook>
Add a project hook.
fn group_members(&self, group: GroupId) -> Result<Vec<Member>>
Get the team members of a group.
fn group_member(&self, group: GroupId, user: UserId) -> Result<Member>
Get a team member of a group.
fn project_members(&self, project: ProjectId) -> Result<Vec<Member>>
Get the team members of a project.
fn project_member(&self, project: ProjectId, user: UserId) -> Result<Member>
Get a team member of a project.
fn add_user_to_project(&self,
project: ProjectId,
user: UserId,
access: AccessLevel)
-> Result<Member>
project: ProjectId,
user: UserId,
access: AccessLevel)
-> Result<Member>
Add a user to a project.
fn branches(&self, project: ProjectId) -> Result<Vec<RepoBranch>>
Get branches for a project.
fn branch(&self, project: ProjectId, branch: &str) -> Result<RepoBranch>
Get a branch.
fn commit(&self, project: ProjectId, commit: &str) -> Result<RepoCommitDetail>
Get a commit.
fn commit_comments(&self,
project: ProjectId,
commit: &str)
-> Result<Vec<CommitNote>>
project: ProjectId,
commit: &str)
-> Result<Vec<CommitNote>>
Get comments on a commit.
fn create_commit_comment(&self,
project: ProjectId,
commit: &str,
body: &str)
-> Result<CommitNote>
project: ProjectId,
commit: &str,
body: &str)
-> Result<CommitNote>
Get comments on a commit.
fn create_commit_line_comment(&self,
project: ProjectId,
commit: &str,
body: &str,
path: &str,
line: u64)
-> Result<CommitNote>
project: ProjectId,
commit: &str,
body: &str,
path: &str,
line: u64)
-> Result<CommitNote>
Get comments on a commit.
fn commit_latest_statuses(&self,
project: ProjectId,
commit: &str)
-> Result<Vec<CommitStatus>>
project: ProjectId,
commit: &str)
-> Result<Vec<CommitStatus>>
Get the latest statuses of a commit.
fn commit_all_statuses(&self,
project: ProjectId,
commit: &str)
-> Result<Vec<CommitStatus>>
project: ProjectId,
commit: &str)
-> Result<Vec<CommitStatus>>
Get the all statuses of a commit.
fn commit_latest_builds(&self,
project: ProjectId,
commit: &str)
-> Result<Vec<Build>>
project: ProjectId,
commit: &str)
-> Result<Vec<Build>>
Get the latest builds of a commit.
fn commit_all_builds(&self,
project: ProjectId,
commit: &str)
-> Result<Vec<Build>>
project: ProjectId,
commit: &str)
-> Result<Vec<Build>>
Get the all builds of a commit.
fn create_commit_status(&self,
project: ProjectId,
sha: &str,
state: StatusState,
info: &CommitStatusInfo)
-> Result<CommitStatus>
project: ProjectId,
sha: &str,
state: StatusState,
info: &CommitStatusInfo)
-> Result<CommitStatus>
Create a status message for a commit.
fn issues(&self, project: ProjectId) -> Result<Vec<Issue>>
Get the issues for a project.
fn issue(&self, project: ProjectId, issue: IssueId) -> Result<Issue>
Get issues.
fn issue_notes(&self, project: ProjectId, issue: IssueId) -> Result<Vec<Note>>
Get the notes from a issue.
fn create_issue_note(&self,
project: ProjectId,
issue: IssueId,
content: &str)
-> Result<Note>
project: ProjectId,
issue: IssueId,
content: &str)
-> Result<Note>
Create a note on a issue.
fn merge_requests(&self, project: ProjectId) -> Result<Vec<MergeRequest>>
Get the merge requests for a project.
fn merge_requests_with_state(&self,
project: ProjectId,
state: MergeRequestStateFilter)
-> Result<Vec<MergeRequest>>
project: ProjectId,
state: MergeRequestStateFilter)
-> Result<Vec<MergeRequest>>
Get the merge requests with a given state.
fn merge_request(&self,
project: ProjectId,
merge_request: MergeRequestId)
-> Result<MergeRequest>
project: ProjectId,
merge_request: MergeRequestId)
-> Result<MergeRequest>
Get merge requests.
fn merge_request_closes_issues(&self,
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<IssueReference>>
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<IssueReference>>
Get the issues that will be closed when a merge request is merged.
fn merge_request_notes(&self,
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<Note>>
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<Note>>
Get the notes from a merge request.
fn award_merge_request_note(&self,
project: ProjectId,
merge_request: MergeRequestId,
note: NoteId,
award: &str)
-> Result<AwardEmoji>
project: ProjectId,
merge_request: MergeRequestId,
note: NoteId,
award: &str)
-> Result<AwardEmoji>
Award a merge request note with an award.
fn merge_request_awards(&self,
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<AwardEmoji>>
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<AwardEmoji>>
Get the awards for a merge request.
fn merge_request_note_awards(&self,
project: ProjectId,
merge_request: MergeRequestId,
note: NoteId)
-> Result<Vec<AwardEmoji>>
project: ProjectId,
merge_request: MergeRequestId,
note: NoteId)
-> Result<Vec<AwardEmoji>>
Get the awards for a merge request note.
fn create_merge_request_note(&self,
project: ProjectId,
merge_request: MergeRequestId,
content: &str)
-> Result<Note>
project: ProjectId,
merge_request: MergeRequestId,
content: &str)
-> Result<Note>
Create a note on a merge request.
fn get_issues_closed_by_merge_request(&self,
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<Issue>>
project: ProjectId,
merge_request: MergeRequestId)
-> Result<Vec<Issue>>
Get issues closed by a merge request.
fn set_issue_labels<I, L>(&self,
project: ProjectId,
issue: IssueId,
labels: I)
-> Result<Issue> where I: IntoIterator<Item=L>, L: Display
project: ProjectId,
issue: IssueId,
labels: I)
-> Result<Issue> where I: IntoIterator<Item=L>, L: Display
Set the labels on an issue.