// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace k8s.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// A topology selector requirement is a selector that matches given label.
    /// This is an alpha feature and may change in the future.
    /// </summary>
    public partial class V1TopologySelectorLabelRequirement
    {
        /// <summary>
        /// Initializes a new instance of the
        /// V1TopologySelectorLabelRequirement class.
        /// </summary>
        public V1TopologySelectorLabelRequirement()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// V1TopologySelectorLabelRequirement class.
        /// </summary>
        /// <param name="key">The label key that the selector applies
        /// to.</param>
        /// <param name="values">An array of string values. One value must
        /// match the label to be selected. Each entry in Values is
        /// ORed.</param>
        public V1TopologySelectorLabelRequirement(string key, IList<string> values)
        {
            Key = key;
            Values = values;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the label key that the selector applies to.
        /// </summary>
        [JsonProperty(PropertyName = "key")]
        public string Key { get; set; }

        /// <summary>
        /// Gets or sets an array of string values. One value must match the
        /// label to be selected. Each entry in Values is ORed.
        /// </summary>
        [JsonProperty(PropertyName = "values")]
        public IList<string> Values { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Key == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Key");
            }
            if (Values == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Values");
            }
        }
    }
}
