using GitHub.Services.WebApi; using System; using System.Runtime.Serialization; using System.ComponentModel; namespace GitHub.DistributedTask.WebApi { /// /// An organization-level grouping of agents. /// [DataContract] public class TaskAgentPool : TaskAgentPoolReference { internal TaskAgentPool() { } public TaskAgentPool(String name) { this.Name = name; } private TaskAgentPool(TaskAgentPool poolToBeCloned) { this.AutoProvision = poolToBeCloned.AutoProvision; this.CreatedOn = poolToBeCloned.CreatedOn; this.Id = poolToBeCloned.Id; this.IsHosted = poolToBeCloned.IsHosted; this.Name = poolToBeCloned.Name; this.Scope = poolToBeCloned.Scope; this.Size = poolToBeCloned.Size; this.PoolType = poolToBeCloned.PoolType; this.AgentCloudId = poolToBeCloned.AgentCloudId; this.TargetSize = poolToBeCloned.TargetSize; this.IsLegacy = poolToBeCloned.IsLegacy; if (poolToBeCloned.m_properties != null) { m_properties = new PropertiesCollection(poolToBeCloned.m_properties); } } /// /// The date/time of the pool creation. /// [DataMember] public DateTime CreatedOn { get; internal set; } /// /// Whether or not a queue should be automatically provisioned for /// each project collection. /// [DataMember] public Boolean? AutoProvision { get; set; } /// /// Whether or not the pool should autosize itself based on the /// Agent Cloud Provider settings. /// [DataMember] public Boolean? AutoSize { get; set; } /// /// Target parallelism. /// [DataMember] public Int32? TargetSize { get; set; } /// /// The ID of the associated agent cloud. /// [DataMember] public Int32? AgentCloudId { get; set; } /// /// Properties which may be used to extend the storage fields available /// for a given machine instance. /// public PropertiesCollection Properties { get { if (m_properties == null) { m_properties = new PropertiesCollection(); } return m_properties; } internal set { m_properties = value; } } public new TaskAgentPool Clone() { return new TaskAgentPool(this); } [DataMember(IsRequired = false, EmitDefaultValue = false, Name = "Properties")] private PropertiesCollection m_properties; } }