mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-26 16:07:56 +00:00
add GetAll Method for uri and accepts
add api fix GetAllMethod fix ApiOptions
This commit is contained in:
@@ -37,13 +37,12 @@ namespace Octokit
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <param name="reaction">The reaction for </param>
|
||||
/// <returns></returns>
|
||||
public Task<IReadOnlyList<Reaction>> ListReactions(string owner, string name, int number, NewReaction reaction)
|
||||
public Task<IReadOnlyList<Reaction>> ListReactions(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(reaction, "reaction");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
return ApiConnection.Get<Reaction>(ApiUrls.CommitCommentReaction(owner, name, number),"", AcceptHeaders.ReactionsPreview);
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.CommitCommentReaction(owner, name, number), AcceptHeaders.ReactionsPreview);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,19 @@ namespace Octokit
|
||||
return GetAll<T>(uri, parameters, null, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all API resources in the list at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the API resource in the list.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns><see cref="IReadOnlyList{T}"/> of the The API resources in the list.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public Task<IReadOnlyList<T>> GetAll<T>(Uri uri, string accepts)
|
||||
{
|
||||
return GetAll<T>(uri, null, accepts, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all API resources in the list at the specified URI.
|
||||
/// </summary>
|
||||
@@ -463,7 +476,7 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
Ensure.ArgumentNotNull(accepts, "accepts");
|
||||
|
||||
|
||||
return Connection.Delete(uri, data, accepts);
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -91,6 +91,16 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
Task<IReadOnlyList<T>> GetAll<T>(Uri uri, IDictionary<string, string> parameters);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all API resources in the list at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the API resource in the list.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns><see cref="IReadOnlyList{T}"/> of the The API resources in the list.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
Task<IReadOnlyList<T>> GetAll<T>(Uri uri, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all API resources in the list at the specified URI.
|
||||
/// </summary>
|
||||
@@ -301,7 +311,7 @@ namespace Octokit
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
Task Delete(Uri uri, object data, string accepts);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for
|
||||
/// API calls which wants to return the redirect URL.
|
||||
|
||||
Reference in New Issue
Block a user