added new overloads

This commit is contained in:
Alexander Efremov
2016-06-13 17:15:50 +07:00
parent 783d957203
commit 8c5c576e53
4 changed files with 263 additions and 1 deletions
@@ -22,6 +22,17 @@ namespace Octokit.Reactive
/// <param name="number">The issue number</param>
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
IObservable<EventInfo> GetAllForIssue(string owner, string name, int number);
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
IObservable<EventInfo> GetAllForIssue(int repositoryId, int number);
/// <summary>
/// Gets all events for the issue.
@@ -36,6 +47,18 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
IObservable<EventInfo> GetAllForIssue(string owner, string name, int number, ApiOptions options);
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
IObservable<EventInfo> GetAllForIssue(int repositoryId, int number, ApiOptions options);
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -47,6 +70,16 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
IObservable<IssueEvent> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
IObservable<IssueEvent> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -59,6 +92,17 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
IObservable<IssueEvent> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
IObservable<IssueEvent> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets a single event
/// </summary>
@@ -72,5 +116,18 @@ namespace Octokit.Reactive
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
IObservable<IssueEvent> Get(string owner, string name, int number);
/// <summary>
/// Gets a single event
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The event id</param>
/// <returns>A <see cref="IssueEvent"/> representing issue event for specified number.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
IObservable<IssueEvent> Get(int repositoryId, int number);
}
}
@@ -41,6 +41,20 @@ namespace Octokit.Reactive
return GetAllForIssue(owner, name, number, ApiOptions.None);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
public IObservable<EventInfo> GetAllForIssue(int repositoryId, int number)
{
return GetAllForIssue(repositoryId, number, ApiOptions.None);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
@@ -61,6 +75,23 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<EventInfo>(ApiUrls.IssuesEvents(owner, name, number), options);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
public IObservable<EventInfo> GetAllForIssue(int repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<EventInfo>(ApiUrls.IssuesEvents(repositoryId, number), options);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -78,6 +109,19 @@ namespace Octokit.Reactive
return GetAllForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
public IObservable<IssueEvent> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, ApiOptions.None);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -97,6 +141,22 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<IssueEvent>(ApiUrls.IssuesEvents(owner, name), options);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IObservable{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
public IObservable<IssueEvent> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<IssueEvent>(ApiUrls.IssuesEvents(repositoryId), options);
}
/// <summary>
/// Gets a single event
/// </summary>
@@ -114,5 +174,19 @@ namespace Octokit.Reactive
return _client.Get(owner, name, number).ToObservable();
}
/// <summary>
/// Gets a single event
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The event id</param>
/// <returns>A <see cref="IssueEvent"/> representing issue event for specified number.</returns>
public IObservable<IssueEvent> Get(int repositoryId, int number)
{
return _client.Get(repositoryId, number).ToObservable();
}
}
}
+58 -1
View File
@@ -24,6 +24,17 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
Task<IReadOnlyList<EventInfo>> GetAllForIssue(string owner, string name, int number);
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
Task<IReadOnlyList<EventInfo>> GetAllForIssue(int repositoryId, int number);
/// <summary>
/// Gets all events for the issue.
/// </summary>
@@ -37,6 +48,18 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
Task<IReadOnlyList<EventInfo>> GetAllForIssue(string owner, string name, int number, ApiOptions options);
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
Task<IReadOnlyList<EventInfo>> GetAllForIssue(int repositoryId, int number, ApiOptions options);
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -48,6 +71,16 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
Task<IReadOnlyList<IssueEvent>> GetAllForRepository(string owner, string name);
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
Task<IReadOnlyList<IssueEvent>> GetAllForRepository(int repositoryId);
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -60,6 +93,17 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
Task<IReadOnlyList<IssueEvent>> GetAllForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
Task<IReadOnlyList<IssueEvent>> GetAllForRepository(int repositoryId, ApiOptions options);
/// <summary>
/// Gets a single event
/// </summary>
@@ -71,7 +115,20 @@ namespace Octokit
/// <param name="number">The event id</param>
/// <returns>A <see cref="IssueEvent"/> representing issue event for specified number.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Justification = "Method makes a network request")]
Task<IssueEvent> Get(string owner, string name, int number);
/// <summary>
/// Gets a single event
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The event id</param>
/// <returns>A <see cref="IssueEvent"/> representing issue event for specified number.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<IssueEvent> Get(int repositoryId, int number);
}
}
+74
View File
@@ -35,6 +35,20 @@ namespace Octokit
return GetAllForIssue(owner, name, number, ApiOptions.None);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
public Task<IReadOnlyList<EventInfo>> GetAllForIssue(int repositoryId, int number)
{
return GetAllForIssue(repositoryId, number, ApiOptions.None);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
@@ -55,6 +69,23 @@ namespace Octokit
return ApiConnection.GetAll<EventInfo>(ApiUrls.IssuesEvents(owner, name, number), options);
}
/// <summary>
/// Gets all events for the issue.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-an-issue
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{EventInfo}"/> of <see cref="EventInfo"/>s representing event information for specified number.</returns>
public Task<IReadOnlyList<EventInfo>> GetAllForIssue(int repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<EventInfo>(ApiUrls.IssuesEvents(repositoryId, number), options);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -72,6 +103,19 @@ namespace Octokit
return GetAllForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
public Task<IReadOnlyList<IssueEvent>> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, ApiOptions.None);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
@@ -91,6 +135,22 @@ namespace Octokit
return ApiConnection.GetAll<IssueEvent>(ApiUrls.IssuesEvents(owner, name), options);
}
/// <summary>
/// Gets all events for the repository.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#list-events-for-a-repository
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>A <see cref="IReadOnlyList{IssueEvent}"/> of <see cref="IssueEvent"/>s representing issue events for specified repository.</returns>
public Task<IReadOnlyList<IssueEvent>> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<IssueEvent>(ApiUrls.IssuesEvents(repositoryId), options);
}
/// <summary>
/// Gets a single event
/// </summary>
@@ -108,5 +168,19 @@ namespace Octokit
return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(owner, name, number));
}
/// <summary>
/// Gets a single event
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/issues/events/#get-a-single-event
/// </remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The event id</param>
/// <returns>A <see cref="IssueEvent"/> representing issue event for specified number.</returns>
public Task<IssueEvent> Get(int repositoryId, int number)
{
return ApiConnection.Get<IssueEvent>(ApiUrls.IssuesEvent(repositoryId, number));
}
}
}