updateLabel method

Future<IssueLabel> updateLabel(
  1. RepositorySlug slug,
  2. String name, {
  3. String? newName,
  4. String? color,
  5. String? description,
})

Implementation

Future<IssueLabel> updateLabel(
  RepositorySlug slug,
  String name, {
  String? newName,
  String? color,
  String? description,
}) {
  return github.patchJSON(
    '/repos/${slug.fullName}/labels/$name',
    body: GitHubJson.encode({
      if (newName != null) 'new_name': newName,
      if (color != null) 'color': color,
      if (description != null) 'description': description,
    }),
    convert: IssueLabel.fromJson,
  );
}