replaceLabelsForIssue method
Future<List<IssueLabel> >
replaceLabelsForIssue(
- RepositorySlug slug,
- int issueNumber,
- List<
String> labels
Replaces all labels for an issue.
API docs: https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue
Implementation
Future<List<IssueLabel>> replaceLabelsForIssue(
RepositorySlug slug,
int issueNumber,
List<String> labels,
) {
return github
.request(
'PUT',
'/repos/${slug.fullName}/issues/$issueNumber/labels',
body: GitHubJson.encode(labels),
)
.then((response) {
return jsonDecode(response.body).map(IssueLabel.fromJson);
});
}