mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 04:40:54 +00:00
Implemented DeploymentStatusesClient and unit tests
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class DeploymentStatusClient : ApiClient, IDeploymentStatusClient
|
||||
{
|
||||
const string acceptsHeader = "application/vnd.github.cannonball-preview+json";
|
||||
|
||||
public DeploymentStatusClient(IApiConnection apiConnection)
|
||||
: base(apiConnection)
|
||||
{
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<DeploymentStatus>> GetAll(string owner, string name, int deploymentId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
return ApiConnection.GetAll<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId),
|
||||
null, acceptsHeader);
|
||||
}
|
||||
|
||||
public Task<DeploymentStatus> Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus");
|
||||
|
||||
return ApiConnection.Post<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId),
|
||||
newDeploymentStatus, acceptsHeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user