Move Releases API to RepositoriesClient.

Releases are grouped under Repositories on developer.github.com.
This commit is contained in:
Matt Burke
2013-10-02 10:36:40 -04:00
committed by Haacked
parent 56406646e3
commit 903fb84d97
14 changed files with 96 additions and 73 deletions
+15
View File
@@ -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);
}
}
}