mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Implement Check Runs API (#1847)
* Add CheckRunEventPayload * add CheckRunEventPayload into all the right places * forgot integration tests for RepositoryId methods (+1 squashed commits) Squashed commits: [b2445bf3] Implement Create CheckRun methods for normal and observable clients including unit and integration tests and xmldoc comments * Implement Update CheckRun method Refactored NewCheckRun to inherit CheckRunUpdate since they share all fields except HeadSha * Implement GetAllForReference method * Implement GetAllForCheckSuite method * tweak XmlDoc to match github documentation * Implement Get method * Implement GetAllAnnotations Moved CheckRunAnnotation model from Request to Common and added a parameterless ctor, since it is now a response model as well as a request model * Split common CheckRunAnnotation model into separate response and request models due to different field and ctor requirements Rename other CheckRun request sub classes to be consistent with NewCheckRunAnnotation (eg NewCheckRunOutput, NewCheckRunImage, etc) * add title field back into CheckRunAnnotation * fix up XmlDocs * fix mutable response property - hooray for convention tests!
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class CheckRunAnnotation
|
||||
{
|
||||
public CheckRunAnnotation()
|
||||
{
|
||||
}
|
||||
|
||||
public CheckRunAnnotation(string filename, string blobHref, int startLine, int endLine, CheckWarningLevel warningLevel, string message, string title, string rawDetails)
|
||||
{
|
||||
Filename = filename;
|
||||
BlobHref = blobHref;
|
||||
StartLine = startLine;
|
||||
EndLine = endLine;
|
||||
WarningLevel = warningLevel;
|
||||
Message = message;
|
||||
Title = title;
|
||||
RawDetails = rawDetails;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The path of the file the annotation refers to
|
||||
/// </summary>
|
||||
public string Filename { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The file's full blob URL
|
||||
/// </summary>
|
||||
public string BlobHref { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The start line of the annotation
|
||||
/// </summary>
|
||||
public int StartLine { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The end line of the annotation
|
||||
/// </summary>
|
||||
public int EndLine { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The warning level of the annotation. Can be one of notice, warning, or failure
|
||||
/// </summary>
|
||||
public StringEnum<CheckWarningLevel> WarningLevel { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// A short description of the feedback for these lines of code
|
||||
/// </summary>
|
||||
public string Message { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The title that represents the annotation
|
||||
/// </summary>
|
||||
public string Title { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Details about this annotation
|
||||
/// </summary>
|
||||
public string RawDetails { get; protected set; }
|
||||
|
||||
internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Filename: {0}, StartLine: {1}, WarningLevel: {2}", Filename, StartLine, WarningLevel.DebuggerDisplay);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user