addLabelsToIssue method
- RepositorySlug slug,
- int issueNumber,
- List<
String> labels
Adds labels to an issue.
API docs: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
Implementation
Future<List<IssueLabel>> addLabelsToIssue(
RepositorySlug slug,
int issueNumber,
List<String> labels,
) {
return github.postJSON<List<dynamic>, List<IssueLabel>>(
'/repos/${slug.fullName}/issues/$issueNumber/labels',
body: GitHubJson.encode(labels),
convert:
(input) =>
input
.cast<Map<String, dynamic>>()
.map(IssueLabel.fromJson)
.toList(),
);
}