added new overloads

This commit is contained in:
aedampir@gmail.com
2016-06-16 14:35:00 +07:00
parent 4d8c07eee6
commit 537c18e043
4 changed files with 279 additions and 1 deletions
+81 -1
View File
@@ -85,6 +85,17 @@ namespace Octokit
return GetAllForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
/// <param name="repositoryId">The ID of the repository.</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Notification}"/> of <see cref="Notification"/>.</returns>
public Task<IReadOnlyList<Notification>> GetAllForRepository(int repositoryId)
{
return GetAllForRepository(repositoryId, ApiOptions.None);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
@@ -102,6 +113,20 @@ namespace Octokit
return ApiConnection.GetAll<Notification>(ApiUrls.Notifications(owner, name), options);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
/// <param name="repositoryId">The ID of the repository.</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Notification}"/> of <see cref="Notification"/>.</returns>
public Task<IReadOnlyList<Notification>> GetAllForRepository(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<Notification>(ApiUrls.Notifications(repositoryId), options);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
@@ -119,6 +144,20 @@ namespace Octokit
return GetAllForRepository(owner, name, request, ApiOptions.None);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
/// <param name="repositoryId">The ID of the repository.</param>
/// <param name="request">Specifies the parameters to filter notifications by</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Notification}"/> of <see cref="Notification"/>.</returns>
public Task<IReadOnlyList<Notification>> GetAllForRepository(int repositoryId, NotificationsRequest request)
{
Ensure.ArgumentNotNull(request, "request");
return GetAllForRepository(repositoryId, request, ApiOptions.None);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
@@ -138,6 +177,22 @@ namespace Octokit
return ApiConnection.GetAll<Notification>(ApiUrls.Notifications(owner, name), request.ToParametersDictionary(), options);
}
/// <summary>
/// Retrieves all of the <see cref="Notification"/>s for the current user specific to the specified repository.
/// </summary>
/// <param name="repositoryId">The ID of the repository.</param>
/// <param name="request">Specifies the parameters to filter notifications by</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Notification}"/> of <see cref="Notification"/>.</returns>
public Task<IReadOnlyList<Notification>> GetAllForRepository(int repositoryId, NotificationsRequest request, ApiOptions options)
{
Ensure.ArgumentNotNull(request, "request");
Ensure.ArgumentNotNull(options, "options");
return ApiConnection.GetAll<Notification>(ApiUrls.Notifications(repositoryId), request.ToParametersDictionary(), options);
}
/// <summary>
/// Marks all notifications as read.
/// </summary>
@@ -176,6 +231,17 @@ namespace Octokit
return ApiConnection.Put(ApiUrls.Notifications(owner, name));
}
/// <summary>
/// Marks the notifications for a given repository as read.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository</remarks>
/// <returns></returns>
public Task MarkAsReadForRepository(int repositoryId)
{
return ApiConnection.Put(ApiUrls.Notifications(repositoryId));
}
/// <summary>
/// Marks the notifications for a given repository as read.
/// </summary>
@@ -188,11 +254,25 @@ namespace Octokit
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(markAsReadRequest, "markAsRead");
Ensure.ArgumentNotNull(markAsReadRequest, "markAsReadRequest");
return ApiConnection.Put<object>(ApiUrls.Notifications(owner, name), markAsReadRequest);
}
/// <summary>
/// Marks the notifications for a given repository as read.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="markAsReadRequest">The <see cref="MarkAsReadRequest"/> parameter which specifies which notifications to mark.</param>
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository</remarks>
/// <returns></returns>
public Task MarkAsReadForRepository(int repositoryId, MarkAsReadRequest markAsReadRequest)
{
Ensure.ArgumentNotNull(markAsReadRequest, "markAsReadRequest");
return ApiConnection.Put<object>(ApiUrls.Notifications(repositoryId), markAsReadRequest);
}
/// <summary>
/// Retrives a single <see cref="Notification"/> by Id.
/// </summary>