Files
runner/src/Sdk/DTWebApi/WebApi/TaskAttachment.cs
Yang Cao aaf02ab34c Properly guard upload (#2439)
* Revert "Revert "Uploading step logs to Results as well  (#2422)" (#2437)"

This reverts commit 8c096baf49.

* Properly guard the upload to results feature

* Delete skipped file if deletesource is true
2023-02-17 10:31:41 -05:00

112 lines
2.6 KiB
C#

using GitHub.Services.Common;
using GitHub.Services.WebApi;
using System;
using System.Runtime.Serialization;
namespace GitHub.DistributedTask.WebApi
{
[DataContract]
public class TaskAttachment
{
internal TaskAttachment()
{ }
internal TaskAttachment(String type, String name, ReferenceLinks links)
{
ArgumentUtility.CheckStringForNullOrEmpty(type, "type");
ArgumentUtility.CheckStringForNullOrEmpty(name, "name");
this.Type = type;
this.Name = name;
this.m_links = links;
}
public TaskAttachment(String type, String name)
{
ArgumentUtility.CheckStringForNullOrEmpty(type, "type");
ArgumentUtility.CheckStringForNullOrEmpty(name, "name");
this.Type = type;
this.Name = name;
}
[DataMember]
public String Type
{
get;
internal set;
}
[DataMember]
public String Name
{
get;
internal set;
}
public ReferenceLinks Links
{
get
{
if (m_links == null)
{
m_links = new ReferenceLinks();
}
return m_links;
}
}
[DataMember]
public DateTime CreatedOn
{
get;
internal set;
}
[DataMember]
public DateTime LastChangedOn
{
get;
internal set;
}
[DataMember]
public Guid LastChangedBy
{
get;
internal set;
}
[DataMember]
public Guid TimelineId
{
get;
set;
}
[DataMember]
public Guid RecordId
{
get;
set;
}
[DataMember(Name = "_links", EmitDefaultValue = false)]
private ReferenceLinks m_links;
}
[GenerateAllConstants]
public class CoreAttachmentType
{
public static readonly String Log = "DistributedTask.Core.Log";
public static readonly String Summary = "DistributedTask.Core.Summary";
public static readonly String FileAttachment = "DistributedTask.Core.FileAttachment";
public static readonly String DiagnosticLog = "DistributedTask.Core.DiagnosticLog";
public static readonly String ResultsLog = "Results.Core.Log";
}
[GenerateAllConstants]
public class ChecksAttachmentType
{
public static readonly String StepSummary = "Checks.Step.Summary";
}
}