using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using GitHub.Services.WebApi;
namespace GitHub.Build.WebApi
{
///
/// Represents an issue (error, warning) associated with a build.
///
[DataContract]
public class Issue : BaseSecuredObject
{
public Issue()
{
}
internal Issue(
ISecuredObject securedObject)
: base(securedObject)
{
}
private Issue(
Issue issueToBeCloned)
: base(issueToBeCloned)
{
this.Type = issueToBeCloned.Type;
this.Category = issueToBeCloned.Category;
this.Message = issueToBeCloned.Message;
if (issueToBeCloned.m_data != null)
{
foreach (var item in issueToBeCloned.m_data)
{
this.Data.Add(item);
}
}
}
///
/// The type (error, warning) of the issue.
///
[DataMember(Order = 1)]
public IssueType Type
{
get;
set;
}
///
/// The category.
///
[DataMember(Order = 2)]
public String Category
{
get;
set;
}
///
/// A description of the issue.
///
[DataMember(Order = 3)]
public String Message
{
get;
set;
}
///
/// A dictionary containing details about the issue.
///
public IDictionary Data
{
get
{
if (m_data == null)
{
m_data = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
return m_data;
}
}
///
/// Clones this object.
///
///
public Issue Clone()
{
return new Issue(this);
}
[DataMember(Name = "Data", EmitDefaultValue = false, Order = 4)]
private IDictionary m_data;
}
}