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<ProjectHook>>
Get a project's hooks.
fn hook(&self, project: ProjectId, hook: HookId) -> Result<ProjectHook>
Get a project hook.
fn add_hook(
&self,
project: ProjectId,
url: &str,
events: WebhookEvents
) -> Result<ProjectHook>
&self,
project: ProjectId,
url: &str,
events: WebhookEvents
) -> Result<ProjectHook>
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>
&self,
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>>
&self,
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>
&self,
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>
&self,
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>>
&self,
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>>
&self,
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<Job>>
&self,
project: ProjectId,
commit: &str
) -> Result<Vec<Job>>
Get the latest builds of a commit.
fn commit_all_builds(
&self,
project: ProjectId,
commit: &str
) -> Result<Vec<Job>>
&self,
project: ProjectId,
commit: &str
) -> Result<Vec<Job>>
Get the all builds of a commit.
fn create_commit_status(
&self,
project: ProjectId,
sha: &str,
state: StatusState,
info: &CommitStatusInfo
) -> Result<CommitStatus>
&self,
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: IssueInternalId) -> Result<Issue>
Get issues.
fn issue_notes(
&self,
project: ProjectId,
issue: IssueInternalId
) -> Result<Vec<Note>>
&self,
project: ProjectId,
issue: IssueInternalId
) -> Result<Vec<Note>>
Get the notes from a issue.
fn create_issue_note(
&self,
project: ProjectId,
issue: IssueInternalId,
content: &str
) -> Result<Note>
&self,
project: ProjectId,
issue: IssueInternalId,
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>>
&self,
project: ProjectId,
state: MergeRequestStateFilter
) -> Result<Vec<MergeRequest>>
Get the merge requests with a given state.
fn merge_request(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<MergeRequest>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<MergeRequest>
Get merge requests.
fn merge_request_closes_issues(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<IssueReference>>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> 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: MergeRequestInternalId
) -> Result<Vec<Note>>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<Note>>
Get the notes from a merge request.
fn award_merge_request_note(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId,
award: &str
) -> Result<AwardEmoji>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId,
award: &str
) -> Result<AwardEmoji>
Award a merge request note with an award.
fn merge_request_awards(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<AwardEmoji>>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<AwardEmoji>>
Get the awards for a merge request.
fn merge_request_note_awards(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId
) -> Result<Vec<AwardEmoji>>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId
) -> Result<Vec<AwardEmoji>>
Get the awards for a merge request note.
fn create_merge_request_note(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
content: &str
) -> Result<Note>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
content: &str
) -> Result<Note>
Create a note on a merge request.
fn get_issues_closed_by_merge_request(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<Issue>>
&self,
project: ProjectId,
merge_request: MergeRequestInternalId
) -> Result<Vec<Issue>>
Get issues closed by a merge request.
fn set_issue_labels<I, L>(
&self,
project: ProjectId,
issue: IssueInternalId,
labels: I
) -> Result<Issue> where
I: IntoIterator<Item = L>,
L: Display,
&self,
project: ProjectId,
issue: IssueInternalId,
labels: I
) -> Result<Issue> where
I: IntoIterator<Item = L>,
L: Display,
Set the labels on an issue.