mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
Move Releases API to RepositoriesClient.
Releases are grouped under Repositories on developer.github.com.
This commit is contained in:
@@ -54,6 +54,13 @@ namespace Octokit.Http
|
||||
return await pagination.GetAllPages(async () => await GetPage(endpoint, parameters));
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyCollection<TOther>> GetAll<TOther>(Uri endpoint, IDictionary<string, string> parameters)
|
||||
{
|
||||
Ensure.ArgumentNotNull(endpoint, "endpoint");
|
||||
|
||||
return await pagination.GetAllPages<TOther>(async () => await GetPage<TOther>(endpoint, parameters));
|
||||
}
|
||||
|
||||
public async Task<T> Create(Uri endpoint, object data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(endpoint, "endpoint");
|
||||
@@ -99,5 +106,13 @@ namespace Octokit.Http
|
||||
return new ReadOnlyPagedCollection<T>(response, Connection);
|
||||
}
|
||||
|
||||
async Task<IReadOnlyPagedCollection<TOther>> GetPage<TOther>(Uri endpoint, IDictionary<string, string> parameters)
|
||||
{
|
||||
Ensure.ArgumentNotNull(endpoint, "endpoint");
|
||||
|
||||
var response = await Connection.GetAsync<List<TOther>>(endpoint, parameters);
|
||||
return new ReadOnlyPagedCollection<TOther>(response, Connection);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user