GitHub Actions Runner

This commit is contained in:
Tingluo Huang
2019-10-10 00:52:42 -04:00
commit c8afc84840
1255 changed files with 198670 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
using System;
using System.Runtime.Serialization;
namespace GitHub.DistributedTask.WebApi
{
[DataContract]
public class TaskDefinitionReference
{
public TaskDefinitionReference()
{
// Default is Task
this.DefinitionType = TaskDefinitionType.Task;
}
private TaskDefinitionReference(TaskDefinitionReference definitionReference)
{
this.Id = definitionReference.Id;
this.VersionSpec = definitionReference.VersionSpec;
// If it is null, we set it to task
this.DefinitionType = definitionReference.DefinitionType ?? TaskDefinitionType.Task;
}
/// <summary>
/// Gets or sets the unique identifier of task.
/// </summary>
[DataMember(IsRequired = true)]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the version specification of task.
/// </summary>
[DataMember(IsRequired = true)]
public String VersionSpec { get; set; }
/// <summary>
/// Gets or sets the definition type. Values can be 'task' or 'metaTask'.
/// </summary>
[DataMember(IsRequired = true)]
public String DefinitionType
{
get
{
return this.m_definitionType ?? (this.m_definitionType = TaskDefinitionType.Task);
}
set
{
this.m_definitionType = value;
}
}
public override bool Equals(object obj)
{
var toEqual = (TaskDefinitionReference)obj;
if (toEqual == null)
{
return false;
}
return this.Id.Equals(toEqual.Id) &&
(this.VersionSpec?.Equals(toEqual.VersionSpec) ?? this.VersionSpec == toEqual.VersionSpec) &&
(this.DefinitionType?.Equals(toEqual.DefinitionType) ?? this.DefinitionType == toEqual.DefinitionType);
}
public override int GetHashCode()
{
return this.ToString().GetHashCode();
}
internal TaskDefinitionReference Clone()
{
return new TaskDefinitionReference(this);
}
private String m_definitionType;
}
}