/// <summary> /// Updates a label. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/issues/labels/#update-a-label">API documentation</a> for more information. /// </remarks> /// <param name="owner">The owner of the repository</param> /// <param name="name">The name of the repository</param> /// <param name="labelName">The name of the label</param> /// <param name="labelUpdate">The data for the label to be updated</param> public IObservable <Label> Update(string owner, string name, string labelName, LabelUpdate labelUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(labelName, nameof(labelName)); Ensure.ArgumentNotNull(labelUpdate, nameof(labelUpdate)); return(_client.Update(owner, name, labelName, labelUpdate).ToObservable()); }
public async Task CanUpdateIssueLabel() { var newLabel = new NewLabel("test label", "FFFFFF") { Description = "Test label description." }; var label = await _issuesLabelsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newLabel); Assert.NotNull(label); var labelUpdate = new LabelUpdate("test label", "000000") { Description = "Updated label description." }; label = await _issuesLabelsClient.Update(_context.RepositoryOwner, _context.RepositoryName, labelUpdate.Name, labelUpdate); Assert.NotNull(label); var issueLabelLookupByName = await _issuesLabelsClient.Get(_context.RepositoryOwner, _context.RepositoryName, label.Name); Assert.Equal(labelUpdate.Name, issueLabelLookupByName.Name); Assert.Equal(labelUpdate.Color, issueLabelLookupByName.Color); Assert.Equal(labelUpdate.Description, issueLabelLookupByName.Description); }
/// <summary> /// Updates a label. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/issues/labels/#update-a-label">API documentation</a> for more information. /// </remarks> /// <param name="owner">The owner of the repository</param> /// <param name="repo">The name of the repository</param> /// <param name="name">The name of the label</param> /// <param name="labelUpdate">The data for the label to be updated</param> /// <returns>The updated label</returns>' public IObservable <Label> Update(string owner, string repo, string name, LabelUpdate labelUpdate) { return(_client.Update(owner, repo, name, labelUpdate).ToObservable()); }