mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +00:00
GitHub Actions Runner
This commit is contained in:
60
src/Sdk/DTWebApi/WebApi/ValidationItem.cs
Normal file
60
src/Sdk/DTWebApi/WebApi/ValidationItem.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GitHub.DistributedTask.WebApi
|
||||
{
|
||||
[DataContract]
|
||||
[KnownType(typeof(ExpressionValidationItem))]
|
||||
[KnownType(typeof(InputValidationItem))]
|
||||
[JsonConverter(typeof(ValidationItemJsonConverter))]
|
||||
public class ValidationItem
|
||||
{
|
||||
protected ValidationItem(String type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Type of validation item
|
||||
/// </summary>
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public String Type
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Value to validate.
|
||||
/// The conditional expression to validate for the input for "expression" type
|
||||
/// Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master')
|
||||
/// </summary>
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public String Value
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether the current input is valid or not
|
||||
/// </summary>
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public Boolean? IsValid
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reason for input validation failure
|
||||
/// </summary>
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public String Reason
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user