Add overloads for ApiOptions in Assignees API.

This commit is contained in:
Devesh Khandelwal
2016-03-14 11:06:22 +05:30
parent 2ed5999f08
commit 3618236be3
3 changed files with 28 additions and 1 deletions
@@ -21,7 +21,7 @@ namespace Octokit.Tests.Clients
client.GetAllForRepository("fake", "repo");
connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/assignees"));
connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/assignees"), null, AcceptHeaders.StableVersion, Args.ApiOptions);
}
[Fact]
+18
View File
@@ -33,6 +33,24 @@ namespace Octokit
return ApiConnection.GetAll<User>(ApiUrls.Assignees(owner, name));
}
/// <summary>
/// Gets all the available assignees (owner + collaborators) to which issues may be assigned.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">The options to change API's response.</param>
/// <returns></returns>
public Task<IReadOnlyList<User>> GetAllForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");
var endpoint = ApiUrls.Assignees(owner, name);
return ApiConnection.GetAll<User>(endpoint, null, options);
}
/// <summary>
/// Checks to see if a user is an assignee for a repository.
/// </summary>
+9
View File
@@ -19,6 +19,15 @@ namespace Octokit
/// <returns></returns>
Task<IReadOnlyList<User>> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets all the available assignees (owner + collaborators) to which issues may be assigned.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">The options to chagne API's response.</param>
/// <returns></returns>
Task<IReadOnlyList<User>> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Checks to see if a user is an assignee for a repository.
/// </summary>