added new overloads

This commit is contained in:
aedampir@gmail.com
2016-06-09 23:40:11 +07:00
parent 71e5e2da9a
commit d94f54f074
4 changed files with 228 additions and 6 deletions
@@ -20,6 +20,16 @@ namespace Octokit.Reactive
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
IObservable<CommitStatus> GetAll(string owner, string name, string reference);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
IObservable<CommitStatus> GetAll(int repositoryId, string reference);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
@@ -33,6 +43,17 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
IObservable<CommitStatus> GetAll(string owner, string name, string reference, ApiOptions options);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
IObservable<CommitStatus> GetAll(int repositoryId, string reference, ApiOptions options);
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
@@ -44,6 +65,16 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{CombinedCommitStatus}"/> of <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
IObservable<CombinedCommitStatus> GetCombined(string owner, string name, string reference);
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IObservable{CombinedCommitStatus}"/> of <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
IObservable<CombinedCommitStatus> GetCombined(int repositoryId, string reference);
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
@@ -53,5 +84,14 @@ namespace Octokit.Reactive
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
IObservable<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus newCommitStatus);
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
IObservable<CommitStatus> Create(int repositoryId, string reference, NewCommitStatus newCommitStatus);
}
}
@@ -38,7 +38,22 @@ namespace Octokit.Reactive
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return GetAll(owner, name ,reference, ApiOptions.None);
return GetAll(owner, name ,reference, ApiOptions.None);
}
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public IObservable<CommitStatus> GetAll(int repositoryId, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return GetAll(repositoryId, reference, ApiOptions.None);
}
/// <summary>
@@ -61,6 +76,23 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<CommitStatus>(ApiUrls.CommitStatuses(owner, name, reference), options);
}
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public IObservable<CommitStatus> GetAll(int repositoryId, string reference, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<CommitStatus>(ApiUrls.CommitStatuses(repositoryId, reference), options);
}
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
@@ -79,6 +111,21 @@ namespace Octokit.Reactive
return _client.GetCombined(owner, name, reference).ToObservable();
}
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IObservable{CombinedCommitStatus}"/> of <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
public IObservable<CombinedCommitStatus> GetCombined(int repositoryId, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return _client.GetCombined(repositoryId, reference).ToObservable();
}
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
@@ -92,9 +139,24 @@ namespace Octokit.Reactive
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(newCommitStatus, "commitStatus");
Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus");
return _client.Create(owner, name, reference, newCommitStatus).ToObservable();
}
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
public IObservable<CommitStatus> Create(int repositoryId, string reference, NewCommitStatus newCommitStatus)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus");
return _client.Create(repositoryId, reference, newCommitStatus).ToObservable();
}
}
}
+75 -4
View File
@@ -36,7 +36,24 @@ namespace Octokit
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return GetAll(owner,name,reference,ApiOptions.None);
return GetAll(owner, name, reference, ApiOptions.None);
}
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public Task<IReadOnlyList<CommitStatus>> GetAll(int repositoryId, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return GetAll(repositoryId, reference, ApiOptions.None);
}
/// <summary>
@@ -54,11 +71,30 @@ namespace Octokit
public Task<IReadOnlyList<CommitStatus>> GetAll(string owner, string name, string reference, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<CommitStatus>(ApiUrls.CommitStatuses(owner, name, reference),options);
return ApiConnection.GetAll<CommitStatus>(ApiUrls.CommitStatuses(owner, name, reference), options);
}
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public Task<IReadOnlyList<CommitStatus>> GetAll(int repositoryId, string reference, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<CommitStatus>(ApiUrls.CommitStatuses(repositoryId, reference), options);
}
/// <summary>
@@ -81,6 +117,23 @@ namespace Octokit
return ApiConnection.Get<CombinedCommitStatus>(ApiUrls.CombinedCommitStatus(owner, name, reference));
}
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
public Task<CombinedCommitStatus> GetCombined(int repositoryId, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return ApiConnection.Get<CombinedCommitStatus>(ApiUrls.CombinedCommitStatus(repositoryId, reference));
}
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
@@ -101,5 +154,23 @@ namespace Octokit
return ApiConnection.Post<CommitStatus>(ApiUrls.CreateCommitStatus(owner, name, reference), newCommitStatus);
}
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#create-a-status
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
public Task<CommitStatus> Create(int repositoryId, string reference, NewCommitStatus newCommitStatus)
{
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus");
return ApiConnection.Post<CommitStatus>(ApiUrls.CreateCommitStatus(repositoryId, reference), newCommitStatus);
}
}
}
}
+49
View File
@@ -24,6 +24,18 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
Task<IReadOnlyList<CommitStatus>> GetAll(string owner, string name, string reference);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
Task<IReadOnlyList<CommitStatus>> GetAll(int repositoryId, string reference);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
@@ -38,6 +50,19 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
Task<IReadOnlyList<CommitStatus>> GetAll(string owner, string name, string reference, ApiOptions options);
/// <summary>
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
Task<IReadOnlyList<CommitStatus>> GetAll(int repositoryId, string reference, ApiOptions options);
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
@@ -51,6 +76,18 @@ namespace Octokit
/// <returns>A <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
Task<CombinedCommitStatus> GetCombined(string owner, string name, string reference);
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns>A <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
Task<CombinedCommitStatus> GetCombined(int repositoryId, string reference);
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
@@ -63,5 +100,17 @@ namespace Octokit
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
Task<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus newCommitStatus);
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#create-a-status
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
/// <returns>A <see cref="CommitStatus"/> representing created commit status for specified repository</returns>
Task<CommitStatus> Create(int repositoryId, string reference, NewCommitStatus newCommitStatus);
}
}