using System; using System.Collections.Generic; using System.Runtime.Serialization; namespace GitHub.Build.WebApi { /// /// Represents a template from which new build definitions can be created. /// [DataContract] public class BuildDefinitionTemplate { public BuildDefinitionTemplate() { Category = "Custom"; } /// /// The ID of the template. /// [DataMember(IsRequired = true)] public String Id { get; set; } /// /// The name of the template. /// [DataMember(IsRequired = true)] public String Name { get; set; } /// /// Indicates whether the template can be deleted. /// [DataMember(EmitDefaultValue = true)] public Boolean CanDelete { get; set; } /// /// The template category. /// [DataMember(EmitDefaultValue = true)] public String Category { get; set; } /// /// An optional hosted agent queue for the template to use by default. /// [DataMember(EmitDefaultValue = true)] public String DefaultHostedQueue { get; set; } /// /// The ID of the task whose icon is used when showing this template in the UI. /// [DataMember(EmitDefaultValue = false)] public Guid IconTaskId { get; set; } /// /// A description of the template. /// [DataMember(EmitDefaultValue = false)] public String Description { get; set; } /// /// The actual template. /// [DataMember(EmitDefaultValue = false)] public BuildDefinition Template { get; set; } /// /// A dictionary of media type strings to icons for this template. /// public IDictionary Icons { get { if (m_icons == null) { m_icons = new Dictionary(StringComparer.Ordinal); } return m_icons; } internal set { m_icons = new Dictionary(value, StringComparer.Ordinal); } } [DataMember(EmitDefaultValue = false, Name = "Icons")] private Dictionary m_icons; } }