listStatuses method

Stream<RepositoryStatus> listStatuses(
  1. RepositorySlug slug,
  2. String ref
)

Lists the statuses of a repository at the specified reference. The ref can be a SHA, a branch name, or a tag name.

API docs: https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref

Implementation

Stream<RepositoryStatus> listStatuses(RepositorySlug slug, String ref) {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(ref);
  return PaginationHelper(github)
      .objects<Map<String, dynamic>, RepositoryStatus>(
    'GET',
    '/repos/${slug.fullName}/commits/$ref/statuses',
    (i) => RepositoryStatus.fromJson(i),
  );
}