mirror of
https://github.com/actions/runner.git
synced 2025-12-12 05:37:01 +00:00
GitHub Actions Runner
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace GitHub.Build.WebApi
|
||||
{
|
||||
internal sealed class AgentTargetExecutionOptionsJsonConverter : TypePropertyJsonConverter<AgentTargetExecutionOptions>
|
||||
{
|
||||
protected override AgentTargetExecutionOptions GetInstance(Type objectType)
|
||||
{
|
||||
if (objectType == typeof(AgentTargetExecutionType))
|
||||
{
|
||||
return new AgentTargetExecutionOptions();
|
||||
}
|
||||
else if (objectType == typeof(VariableMultipliersAgentExecutionOptions))
|
||||
{
|
||||
return new VariableMultipliersAgentExecutionOptions();
|
||||
}
|
||||
else if (objectType == typeof(MultipleAgentExecutionOptions))
|
||||
{
|
||||
return new MultipleAgentExecutionOptions();
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.GetInstance(objectType);
|
||||
}
|
||||
}
|
||||
|
||||
protected override AgentTargetExecutionOptions GetInstance(Int32 targetType)
|
||||
{
|
||||
switch (targetType)
|
||||
{
|
||||
case AgentTargetExecutionType.Normal:
|
||||
return new AgentTargetExecutionOptions();
|
||||
case AgentTargetExecutionType.VariableMultipliers:
|
||||
return new VariableMultipliersAgentExecutionOptions();
|
||||
case AgentTargetExecutionType.MultipleAgents:
|
||||
return new MultipleAgentExecutionOptions();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user