mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
39 lines
899 B
C#
39 lines
899 B
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
using GitHub.Services.WebApi;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace GitHub.DistributedTask.Pipelines
|
|
{
|
|
[DataContract]
|
|
public sealed class HostedRunnerShutdownMessage
|
|
{
|
|
public static readonly String MessageType = "RunnerShutdown";
|
|
|
|
[JsonConstructor]
|
|
internal HostedRunnerShutdownMessage()
|
|
{
|
|
}
|
|
|
|
public HostedRunnerShutdownMessage(String reason)
|
|
{
|
|
this.Reason = reason;
|
|
}
|
|
|
|
[DataMember]
|
|
public String Reason
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public WebApi.TaskAgentMessage GetAgentMessage()
|
|
{
|
|
return new WebApi.TaskAgentMessage
|
|
{
|
|
Body = JsonUtility.ToString(this),
|
|
MessageType = HostedRunnerShutdownMessage.MessageType,
|
|
};
|
|
}
|
|
}
|
|
} |