modified XML docs

modified parameters names
added extra null checks
This commit is contained in:
aedampir@gmail.com
2016-06-09 23:31:07 +07:00
parent 27d0077aae
commit 71e5e2da9a
4 changed files with 48 additions and 27 deletions

View File

@@ -2,6 +2,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Git Repository Status API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/statuses/">Repository Statuses API documentation</a> for more information.
/// </remarks>
public interface IObservableCommitStatusClient
{
/// <summary>
@@ -12,7 +18,7 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <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>
@@ -24,7 +30,7 @@ namespace Octokit.Reactive
/// <param name="name">The name 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></returns>
/// <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>
@@ -35,7 +41,7 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <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>
@@ -44,8 +50,8 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="commitStatus">The commit status to create</param>
/// <returns></returns>
IObservable<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus commitStatus);
/// <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);
}
}

View File

@@ -4,6 +4,12 @@ using Octokit.Reactive.Internal;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Git Repository Status API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/statuses/">Repository Statuses API documentation</a> for more information.
/// </remarks>
public class ObservableCommitStatusClient : IObservableCommitStatusClient
{
readonly ICommitStatusClient _client;
@@ -25,7 +31,7 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public IObservable<CommitStatus> GetAll(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -44,7 +50,7 @@ namespace Octokit.Reactive
/// <param name="name">The name 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></returns>
/// <returns>A <see cref="IObservable{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public IObservable<CommitStatus> GetAll(string owner, string name, string reference, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -63,9 +69,13 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <returns>A <see cref="IObservable{CombinedCommitStatus}"/> of <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
public IObservable<CombinedCommitStatus> GetCombined(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return _client.GetCombined(owner, name, reference).ToObservable();
}
@@ -75,11 +85,16 @@ namespace Octokit.Reactive
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="commitStatus">The commit status to create</param>
/// <returns></returns>
public IObservable<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus commitStatus)
/// <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(string owner, string name, string reference, NewCommitStatus newCommitStatus)
{
return _client.Create(owner, name, reference, commitStatus).ToObservable();
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(newCommitStatus, "commitStatus");
return _client.Create(owner, name, reference, newCommitStatus).ToObservable();
}
}
}

View File

@@ -29,7 +29,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public Task<IReadOnlyList<CommitStatus>> GetAll(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -50,7 +50,7 @@ namespace Octokit
/// <param name="name">The name 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></returns>
/// <returns>A <see cref="IReadOnlyList{CommitStatus}"/> of <see cref="CommitStatus"/>es representing commit statuses for specified repository</returns>
public Task<IReadOnlyList<CommitStatus>> GetAll(string owner, string name, string reference, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -71,7 +71,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <returns>A <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
public Task<CombinedCommitStatus> GetCombined(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -90,16 +90,16 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="commitStatus">The commit status to create</param>
/// <returns></returns>
public Task<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus commitStatus)
/// <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(string owner, string name, string reference, NewCommitStatus newCommitStatus)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(commitStatus, "commitStatus");
Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus");
return ApiConnection.Post<CommitStatus>(ApiUrls.CreateCommitStatus(owner, name, reference), commitStatus);
return ApiConnection.Post<CommitStatus>(ApiUrls.CreateCommitStatus(owner, name, reference), newCommitStatus);
}
}
}

View File

@@ -21,7 +21,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <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>
@@ -35,7 +35,7 @@ namespace Octokit
/// <param name="name">The name 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></returns>
/// <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>
@@ -48,7 +48,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
/// <returns>A <see cref="CombinedCommitStatus"/> representing combined commit status for specified repository</returns>
Task<CombinedCommitStatus> GetCombined(string owner, string name, string reference);
/// <summary>
@@ -60,8 +60,8 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="commitStatus">The commit status to create</param>
/// <returns></returns>
Task<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus commitStatus);
/// <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);
}
}