mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
added overloads on I(Observable)RepositoryCommitsClient
This commit is contained in:
@@ -22,6 +22,16 @@ namespace Octokit.Reactive
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "base")]
|
||||
IObservable<CompareResult> Compare(string owner, string name, string @base, string head);
|
||||
|
||||
/// <summary>
|
||||
/// Compare two references in a repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="base">The reference to use as the base commit</param>
|
||||
/// <param name="head">The reference to use as the head commit</param>
|
||||
/// <returns>A <see cref="IObservable{CompareResult}"/> of <see cref="CompareResult"/> for the specified references.</returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "base")]
|
||||
IObservable<CompareResult> Compare(int repositoryId, string @base, string head);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -33,6 +43,16 @@ namespace Octokit.Reactive
|
||||
Justification = "Method makes a network request")]
|
||||
IObservable<GitHubCommit> Get(string owner, string name, string reference);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="reference">The reference for the commit</param>
|
||||
/// <returns>A <see cref="IObservable{CompareResult}"/> of <see cref="GitHubCommit"/> for the specified commit SHA.</returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
|
||||
Justification = "Method makes a network request")]
|
||||
IObservable<GitHubCommit> Get(int repositoryId, string reference);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -41,6 +61,13 @@ namespace Octokit.Reactive
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(int repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -50,6 +77,14 @@ namespace Octokit.Reactive
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(string owner, string name, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(int repositoryId, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -59,6 +94,14 @@ namespace Octokit.Reactive
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(string owner, string name, CommitRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(int repositoryId, CommitRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -69,6 +112,15 @@ namespace Octokit.Reactive
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(string owner, string name, CommitRequest request, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
IObservable<GitHubCommit> GetAll(int repositoryId, CommitRequest request, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Get the SHA-1 of a commit reference
|
||||
/// </summary>
|
||||
@@ -77,5 +129,13 @@ namespace Octokit.Reactive
|
||||
/// <param name="reference">The repository reference</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="string"/> for the specified repository reference.</returns>
|
||||
IObservable<string> GetSha1(string owner, string name, string reference);
|
||||
|
||||
/// <summary>
|
||||
/// Get the SHA-1 of a commit reference
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="reference">The repository reference</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="string"/> for the specified repository reference.</returns>
|
||||
IObservable<string> GetSha1(int repositoryId, string reference);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,18 @@ namespace Octokit.Reactive
|
||||
return _commit.Compare(owner, name, @base, head).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compare two references in a repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="base">The reference to use as the base commit</param>
|
||||
/// <param name="head">The reference to use as the head commit</param>
|
||||
/// <returns>A <see cref="IObservable{CompareResult}"/> of <see cref="CompareResult"/> for the specified references.</returns>
|
||||
public IObservable<CompareResult> Compare(int repositoryId, string @base, string head)
|
||||
{
|
||||
return _commit.Compare(repositoryId, @base, head).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -52,6 +64,19 @@ namespace Octokit.Reactive
|
||||
return _commit.Get(owner, name, reference).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="reference">The reference for the commit</param>
|
||||
/// <returns>A <see cref="IObservable{CompareResult}"/> of <see cref="GitHubCommit"/> for the specified commit SHA.</returns>
|
||||
public IObservable<GitHubCommit> Get(int repositoryId, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
|
||||
|
||||
return _commit.Get(repositoryId, reference).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -66,6 +91,16 @@ namespace Octokit.Reactive
|
||||
return GetAll(owner, name, new CommitRequest(), ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
public IObservable<GitHubCommit> GetAll(int repositoryId)
|
||||
{
|
||||
return GetAll(repositoryId, new CommitRequest(), ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -82,6 +117,19 @@ namespace Octokit.Reactive
|
||||
return GetAll(owner, name, new CommitRequest(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
public IObservable<GitHubCommit> GetAll(int repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return GetAll(repositoryId, new CommitRequest(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -98,6 +146,19 @@ namespace Octokit.Reactive
|
||||
return GetAll(owner, name, request, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
public IObservable<GitHubCommit> GetAll(int repositoryId, CommitRequest request)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, "request");
|
||||
|
||||
return GetAll(repositoryId, request, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
@@ -111,10 +172,26 @@ namespace Octokit.Reactive
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(request, "request");
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name), request.ToParametersDictionary(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all commits for a given repository
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="request">Used to filter list of commits returned</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="GitHubCommit"/>s for the specified repository.</returns>
|
||||
public IObservable<GitHubCommit> GetAll(int repositoryId, CommitRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, "request");
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(repositoryId), request.ToParametersDictionary(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the SHA-1 of a commit reference
|
||||
/// </summary>
|
||||
@@ -130,5 +207,18 @@ namespace Octokit.Reactive
|
||||
|
||||
return _commit.GetSha1(owner, name, reference).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the SHA-1 of a commit reference
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="reference">The repository reference</param>
|
||||
/// <returns>A <see cref="IObservable{GitHubCommit}"/> of <see cref="string"/> for the specified repository reference.</returns>
|
||||
public IObservable<string> GetSha1(int repositoryId, string reference)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
|
||||
|
||||
return _commit.GetSha1(repositoryId, reference).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user