Handle requested_action field for check-runs. (#2197)

This commit is contained in:
Mitch Denny
2020-06-06 05:59:00 +10:00
committed by GitHub
parent 17050e8d89
commit b9d1f448d4
3 changed files with 32 additions and 0 deletions
@@ -107,6 +107,9 @@ namespace Octokit.Tests.Models
]
},
""requested_action"": {
""identifier"": ""dosomeaction""
},
""repository"": {
""id"": 526,
""node_id"": ""MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM="",
@@ -248,6 +251,7 @@ namespace Octokit.Tests.Models
Assert.Equal(4, payload.CheckRun.Id);
Assert.Equal(CheckStatus.Completed, payload.CheckRun.Status);
Assert.Equal(CheckConclusion.Neutral, payload.CheckRun.Conclusion);
Assert.Equal("dosomeaction", payload.RequestedAction.Identifier);
Assert.Equal(5, payload.CheckRun.CheckSuite.Id);
Assert.Equal(CheckStatus.Completed, payload.CheckRun.CheckSuite.Status.Value);
Assert.Equal(CheckConclusion.Neutral, payload.CheckRun.CheckSuite.Conclusion);
@@ -7,5 +7,6 @@ namespace Octokit
{
public string Action { get; protected set; }
public CheckRun CheckRun { get; protected set; }
public CheckRunRequestedAction RequestedAction { get; protected set; }
}
}
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CheckRunRequestedAction
{
public CheckRunRequestedAction()
{
}
public CheckRunRequestedAction(string identifier)
{
Identifier = identifier;
}
/// <summary>
/// The Identifier of the check run requested action.
/// </summary>
public string Identifier { get; protected set; }
internal string DebuggerDisplay => string.Format(CultureInfo.InvariantCulture, "Identifier: {0}", Identifier);
}
}