added new overloads

This commit is contained in:
aedampir@gmail.com
2016-05-25 12:28:23 +07:00
parent 53ef9ba49b
commit 2b41b0d553
4 changed files with 72 additions and 2 deletions
@@ -17,6 +17,20 @@ namespace Octokit.Reactive
/// <returns>All deployment statuses for the given deployment.</returns>
IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId);
/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
/// view deployments.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>All deployment statuses for the given deployment.</returns>
IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId, ApiOptions options);
/// <summary>
/// Creates a new status for the given deployment. Users with push access can create deployment
/// statuses for a given deployment.
@@ -33,8 +33,29 @@ namespace Octokit.Reactive.Clients
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return GetAll(owner, name, deploymentId, ApiOptions.None);
}
/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
/// view deployments.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>All deployment statuses for the given deployment.</returns>
public IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<DeploymentStatus>(
ApiUrls.DeploymentStatuses(owner, name, deploymentId));
ApiUrls.DeploymentStatuses(owner, name, deploymentId), options);
}
/// <summary>
+22 -1
View File
@@ -33,7 +33,28 @@ namespace Octokit
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return ApiConnection.GetAll<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId));
return GetAll(owner, name, deploymentId, ApiOptions.None);
}
/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
/// view deployments.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>All deployment statuses for the given deployment.</returns>
public Task<IReadOnlyList<DeploymentStatus>> GetAll(string owner, string name, int deploymentId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId), options);
}
/// <summary>
@@ -25,6 +25,20 @@ namespace Octokit
/// <returns>All deployment statuses for the given deployment.</returns>
Task<IReadOnlyList<DeploymentStatus>> GetAll(string owner, string name, int deploymentId);
/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
/// view deployments.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>All deployment statuses for the given deployment.</returns>
Task<IReadOnlyList<DeploymentStatus>> GetAll(string owner, string name, int deploymentId, ApiOptions options);
/// <summary>
/// Creates a new status for the given deployment. Users with push access can create deployment
/// statuses for a given deployment.