diff --git a/src/GitLabApiClient/GitLabClient.cs b/src/GitLabApiClient/GitLabClient.cs
index 63705304..b9ffb321 100644
--- a/src/GitLabApiClient/GitLabClient.cs
+++ b/src/GitLabApiClient/GitLabClient.cs
@@ -73,6 +73,7 @@ public GitLabClient(string hostUrl, string authenticationToken = "", HttpMessage
Commits = new CommitsClient(_httpFacade, commitQueryBuilder, commitRefsQueryBuilder, commitStatusesQueryBuilder);
Markdown = new MarkdownClient(_httpFacade);
Pipelines = new PipelineClient(_httpFacade, pipelineQueryBuilder, jobQueryBuilder);
+ Jobs = new JobClient(_httpFacade);
Trees = new TreesClient(_httpFacade, treeQueryBuilder);
Files = new FilesClient(_httpFacade);
Runners = new RunnersClient(_httpFacade);
@@ -151,10 +152,15 @@ public GitLabClient(string hostUrl, string authenticationToken = "", HttpMessage
public IMarkdownClient Markdown { get; }
///
- /// Acess GitLab's Pipeline API.
+ /// Access GitLab's Pipeline API.
///
public IPipelineClient Pipelines { get; }
+ ///
+ /// Access GitLab's Job API.
+ ///
+ public IJobClient Jobs { get; }
+
///
/// Access GitLab's Runners API.
///
diff --git a/src/GitLabApiClient/IJobClient.cs b/src/GitLabApiClient/IJobClient.cs
new file mode 100644
index 00000000..28d36f2c
--- /dev/null
+++ b/src/GitLabApiClient/IJobClient.cs
@@ -0,0 +1,15 @@
+using System.Threading.Tasks;
+using GitLabApiClient.Internal.Paths;
+using GitLabApiClient.Models.Job.Responses;
+
+namespace GitLabApiClient
+{
+ public interface IJobClient
+ {
+ Task GetAsync(ProjectId projectId, int jobId);
+ Task RetryAsync(ProjectId projectId, int jobId);
+ Task PlayAsync(ProjectId projectId, int jobId);
+ Task CancelAsync(ProjectId projectId, int jobId);
+ Task EraseAsync(ProjectId projectId, int jobId);
+ }
+}
diff --git a/src/GitLabApiClient/JobClient.cs b/src/GitLabApiClient/JobClient.cs
new file mode 100644
index 00000000..45f7438f
--- /dev/null
+++ b/src/GitLabApiClient/JobClient.cs
@@ -0,0 +1,29 @@
+using System.Threading.Tasks;
+using GitLabApiClient.Internal.Http;
+using GitLabApiClient.Internal.Paths;
+using GitLabApiClient.Models.Job.Responses;
+
+namespace GitLabApiClient
+{
+ public sealed class JobClient : IJobClient
+ {
+ private readonly GitLabHttpFacade _httpFacade;
+
+ internal JobClient(GitLabHttpFacade httpFacade) => _httpFacade = httpFacade;
+
+ public async Task GetAsync(ProjectId projectId, int jobId) =>
+ await _httpFacade.Get($"projects/{projectId}/jobs/{jobId}");
+
+ public async Task RetryAsync(ProjectId projectId, int jobId) =>
+ await _httpFacade.Post($"projects/{projectId}/jobs/{jobId}/retry");
+
+ public async Task PlayAsync(ProjectId projectId, int jobId) =>
+ await _httpFacade.Post($"projects/{projectId}/jobs/{jobId}/play");
+
+ public async Task CancelAsync(ProjectId projectId, int jobId) =>
+ await _httpFacade.Post($"projects/{projectId}/jobs/{jobId}/cancel");
+
+ public async Task EraseAsync(ProjectId projectId, int jobId) =>
+ await _httpFacade.Post($"projects/{projectId}/jobs/{jobId}/erase");
+ }
+}