This repository has been archived by the owner on May 9, 2022. It is now read-only.
forked from nmklotas/GitLabApiClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
359 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("GitLabApiClient.Test")] |
File renamed without changes.
12 changes: 8 additions & 4 deletions
12
GitLabApiClient/GitLabClient.cs → src/GitLabApiClient/GitLabClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
GitLabApiClient/Models/Issues/Issue.cs → src/GitLabApiClient/Models/Issues/Issue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace GitLabApiClient.Models.Projects | ||
{ | ||
public class Group | ||
{ | ||
[JsonProperty("full_path")] | ||
public string FullPath { get; set; } | ||
|
||
[JsonProperty("parent_id")] | ||
public object ParentId { get; set; } | ||
|
||
[JsonProperty("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonProperty("avatar_url")] | ||
public string AvatarUrl { get; set; } | ||
|
||
[JsonProperty("full_name")] | ||
public string FullName { get; set; } | ||
|
||
[JsonProperty("lfs_enabled")] | ||
public bool LfsEnabled { get; set; } | ||
|
||
[JsonProperty("id")] | ||
public long Id { get; set; } | ||
|
||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("request_access_enabled")] | ||
public bool RequestAccessEnabled { get; set; } | ||
|
||
[JsonProperty("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonProperty("visibility")] | ||
public string Visibility { get; set; } | ||
|
||
[JsonProperty("web_url")] | ||
public string WebUrl { get; set; } | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
GitLabApiClient/Models/Assignee.cs → src/GitLabApiClient/Models/Users/Assignee.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using GitLabApiClient.Http; | ||
using GitLabApiClient.Models.Projects; | ||
using GitLabApiClient.Models.Users; | ||
|
||
namespace GitLabApiClient | ||
{ | ||
public class ProjectsClient | ||
{ | ||
private readonly GitLabHttpFacade _httpFacade; | ||
|
||
internal ProjectsClient(GitLabHttpFacade httpFacade) => | ||
_httpFacade = httpFacade; | ||
|
||
public async Task<IList<Project>> GetAsync() => | ||
await _httpFacade.GetAll<Project>("/projects"); | ||
|
||
public async Task<Project> GetAsync(int projectId) => | ||
await _httpFacade.Get<Project>($"/projects/{projectId}"); | ||
|
||
public async Task<IList<Project>> GetByUserIdAsync(int userId) => | ||
await _httpFacade.GetAll<Project>($"/users/{userId}/projects"); | ||
|
||
public async Task<IList<User>> GetUsers(int projectId) => | ||
await _httpFacade.GetAll<User>($"/projects/{projectId}/users"); | ||
|
||
public async Task<Project> CreateAsync(CreateProjectRequest request) => | ||
await _httpFacade.Post<Project>("/projects", request); | ||
|
||
public async Task DeleteAsync(int id) => | ||
await _httpFacade.Delete($"/projects/{id}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="4.19.4" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> | ||
<PackageReference Include="xunit" Version="2.2.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\GitLabApiClient\GitLabApiClient.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using GitLabApiClient.Http; | ||
|
||
namespace GitLabApiClient.Test | ||
{ | ||
internal static class GitLabApiHelper | ||
{ | ||
public static GitLabHttpFacade GetFacade() | ||
{ | ||
var facade = new GitLabHttpFacade( | ||
"https://gitlab.com/api/v3", "yYZSLFnrKyFsG4uD1Wa6"); | ||
|
||
return facade; | ||
} | ||
|
||
public static int TestProjectId { get; set; } = 4006344; | ||
} | ||
} |
Oops, something went wrong.