createLabel method

Future<IssueLabel> createLabel(
  1. RepositorySlug slug,
  2. String name,
  3. String color
)

Creates a new label on the specified repository.

API docs: https://developer.github.com/v3/issues/labels/#create-a-label

Implementation

Future<IssueLabel> createLabel(
    RepositorySlug slug, String name, String color) {
  return github.postJSON('/repos/${slug.fullName}/labels',
      body: GitHubJson.encode({'name': name, 'color': color}),
      convert: (dynamic i) => IssueLabel.fromJson(i));
}