// <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>
    /// CSINodeSpec holds information about the specification of all CSI
    /// drivers installed on a node
    /// </summary>
    public partial class V1beta1CSINodeSpec
    {
        /// <summary>
        /// Initializes a new instance of the V1beta1CSINodeSpec class.
        /// </summary>
        public V1beta1CSINodeSpec()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1beta1CSINodeSpec class.
        /// </summary>
        /// <param name="drivers">drivers is a list of information of all CSI
        /// Drivers existing on a node. If all drivers in the list are
        /// uninstalled, this can become empty.</param>
        public V1beta1CSINodeSpec(IList<V1beta1CSINodeDriver> drivers)
        {
            Drivers = drivers;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets drivers is a list of information of all CSI Drivers
        /// existing on a node. If all drivers in the list are uninstalled,
        /// this can become empty.
        /// </summary>
        [JsonProperty(PropertyName = "drivers")]
        public IList<V1beta1CSINodeDriver> Drivers { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Drivers == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Drivers");
            }
            if (Drivers != null)
            {
                foreach (var element in Drivers)
                {
                    if (element != null)
                    {
                        element.Validate();
                    }
                }
            }
        }
    }
}
