Skip to content

nmklotas/GitLabApiClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

94dd415 · Nov 13, 2019
Nov 13, 2019
Oct 29, 2019
Nov 13, 2019
Nov 13, 2019
Oct 29, 2019
Oct 11, 2019
Nov 26, 2017
Nov 7, 2019
Oct 29, 2019
Nov 11, 2019
Sep 15, 2017
Oct 26, 2019
Nov 11, 2019
Nov 8, 2019
Oct 22, 2019
Nov 8, 2019

Repository files navigation

GitLabApiClient

Build status Build Status NuGet
GitLabApiClient is a .NET rest client for GitLab API v4 (https://docs.gitlab.com/ce/api/README.html).

Main features

  1. Targets .NET Standard 2.0.
  2. Fully async.
  3. Thread safe.
  4. Multi core paging.
  5. Simple and natural to use.

Quick start

  1. 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");
  1. Use it:
// create a new issue.
await client.Issues.CreateAsync("projectId", new CreateIssueRequest("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("projectPath", new CreateMergeRequest("featureBranch", "master", "Merge request title")
{
    Labels = new[] { "bugfix" },
    Description = "Implement feature"
});