//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
///
/// An empty preferred scheduling term matches all objects with implicit
/// weight 0 (i.e. it's a no-op). A null preferred scheduling term matches
/// no objects (i.e. is also a no-op).
///
public partial class V1PreferredSchedulingTerm
{
///
/// Initializes a new instance of the V1PreferredSchedulingTerm class.
///
public V1PreferredSchedulingTerm()
{
CustomInit();
}
///
/// Initializes a new instance of the V1PreferredSchedulingTerm class.
///
/// A node selector term, associated with the
/// corresponding weight.
/// Weight associated with matching the
/// corresponding nodeSelectorTerm, in the range 1-100.
public V1PreferredSchedulingTerm(V1NodeSelectorTerm preference, int weight)
{
Preference = preference;
Weight = weight;
CustomInit();
}
///
/// An initialization method that performs custom operations like setting defaults
///
partial void CustomInit();
///
/// Gets or sets a node selector term, associated with the
/// corresponding weight.
///
[JsonProperty(PropertyName = "preference")]
public V1NodeSelectorTerm Preference { get; set; }
///
/// Gets or sets weight associated with matching the corresponding
/// nodeSelectorTerm, in the range 1-100.
///
[JsonProperty(PropertyName = "weight")]
public int Weight { get; set; }
///
/// Validate the object.
///
///
/// Thrown if validation fails
///
public virtual void Validate()
{
if (Preference == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Preference");
}
}
}
}