GitLabApiClient is a .NET rest client for GitLab API v4 (https://docs.gitlab.com/ce/api/README.html).
- Targets .NET Standard 2.0.
- Fully async.
- Thread safe.
- Multi core paging.
- Simple and natural to use.
- Authenticate:
// if you have auth token:
var client = new GitLabClient("https://gitlab.example.com", "your_private_token");
// if you want to use username & password:
var client = new GitLabClient("https://gitlab.example.com");
await client.LoginAsync("username", "password");
- Use it:
// create a new issue.
await client.Issues.CreateAsync(new CreateIssueRequest("projectId", "issue title"));
// list issues for a project with specified assignee and labels.
await client.Issues.GetAsync("projectId", o => o.AssigneeId = 100 && o.Labels == new[] { "test-label" });
// create a new merge request featureBranch -> master.
await client.MergeRequests.CreateAsync(new CreateMergeRequest("projectId", "featureBranch", "master", "Merge request title")
{
Labels = new[] { "bugfix" },
Description = "Implement feature"
});
-
Issues API:
Create issue.
Update issue.
Query issues. -
Merges API:
Create merge request.
Update merge request.
Accept merge request.
Delete merge request.
Query merge requests. -
Projects API: Create project.
Update project.
Delete project.
Get project users.
Query projects. -
Users API:
Create user.
Update user.
Delete user.
Get current user session.
Query users. -
Groups API (contributed by @ilijamitkov):
Create group.
Get projects for a group.
Transfer group.
Update group.
Delete group.
Sync group with linked LDAP group.
Create LDAP group link.
Delete LDAP group link.
Delete LDAP for a specific LDAP provider.
Query groups.