using System;
using System.Runtime.Serialization;
namespace GitHub.Build.WebApi
{
///
/// Represents information about resources used by builds in the system.
///
[DataContract]
public sealed class BuildResourceUsage
{
internal BuildResourceUsage()
{
}
internal BuildResourceUsage(Int32 xaml, Int32 dtAgents, Int32 paidAgentSlots, Boolean isThrottlingEnabled = false)
{
this.XamlControllers = xaml;
this.DistributedTaskAgents = dtAgents;
this.TotalUsage = this.XamlControllers + (isThrottlingEnabled ? 0 : this.DistributedTaskAgents);
this.PaidPrivateAgentSlots = paidAgentSlots;
}
///
/// The number of XAML controllers.
///
[DataMember]
public Int32 XamlControllers
{
get;
internal set;
}
///
/// The number of build agents.
///
[DataMember]
public Int32 DistributedTaskAgents
{
get;
internal set;
}
///
/// The total usage.
///
[DataMember]
public Int32 TotalUsage
{
get;
internal set;
}
///
/// The number of paid private agent slots.
///
[DataMember(EmitDefaultValue = false)]
public Int32 PaidPrivateAgentSlots
{
get;
internal set;
}
}
}