Files
octokit.net/Octokit/Models/Request/CheckRunRequest.cs
Ryan Gribble c5d5df5b08 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!
2018-07-19 08:29:12 +10:00

55 lines
1.6 KiB
C#

using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
/// <summary>
/// Details to filter a check suite request, such as by App Id or check run name
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CheckRunRequest : RequestParameters
{
/// <summary>
/// Returns check runs with the specified name.
/// </summary>
[Parameter(Key = "check_name")]
public string CheckName { get; set; }
/// <summary>
/// Returns check runs with the specified status. Can be one of queued, in_progress, or completed.
/// </summary>
[Parameter(Key = "status")]
public StringEnum<CheckStatusFilter>? Status { get; set; }
/// <summary>
/// Filters check runs by their completed_at timestamp. Can be one of latest (returning the most recent check runs) or all. Default: latest
/// </summary>
[Parameter(Key = "filter")]
public StringEnum<CheckRunCompletedAtFilter>? Filter { get; set; }
internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "CheckName: {0}, Status: {1}", CheckName, Status);
}
public enum CheckStatusFilter
{
[Parameter(Value = "queued")]
Queued,
[Parameter(Value = "in_progress")]
InProgress,
[Parameter(Value = "completed")]
Completed,
}
public enum CheckRunCompletedAtFilter
{
[Parameter(Value = "latest")]
Latest,
[Parameter(Value = "all")]
All
}
}