getRepository method
Fetches the repository specified by the slug
.
Implementation
Future<Repository> getRepository(RepositorySlug slug) async {
ArgumentError.checkNotNull(slug);
return github.getJSON<Map<String, dynamic>, Repository>(
'/repos/${slug.owner}/${slug.name}',
convert: Repository.fromJson,
statusCode: StatusCodes.OK,
fail: (http.Response response) {
if (response.statusCode == 404) {
throw RepositoryNotFound(github, slug.fullName);
}
},
);
}