// <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.Linq;

    /// <summary>
    /// Local represents directly-attached storage with node affinity (Beta
    /// feature)
    /// </summary>
    public partial class V1LocalVolumeSource
    {
        /// <summary>
        /// Initializes a new instance of the V1LocalVolumeSource class.
        /// </summary>
        public V1LocalVolumeSource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1LocalVolumeSource class.
        /// </summary>
        /// <param name="path">The full path to the volume on the node. It can
        /// be either a directory or block device (disk, partition, ...).
        /// Directories can be represented only by PersistentVolume with
        /// VolumeMode=Filesystem. Block devices can be represented only by
        /// VolumeMode=Block, which also requires the BlockVolume alpha feature
        /// gate to be enabled.</param>
        public V1LocalVolumeSource(string path)
        {
            Path = path;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets the full path to the volume on the node. It can be
        /// either a directory or block device (disk, partition, ...).
        /// Directories can be represented only by PersistentVolume with
        /// VolumeMode=Filesystem. Block devices can be represented only by
        /// VolumeMode=Block, which also requires the BlockVolume alpha feature
        /// gate to be enabled.
        /// </summary>
        [JsonProperty(PropertyName = "path")]
        public string Path { get; set; }

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