// <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>
    /// PortworxVolumeSource represents a Portworx volume resource.
    /// </summary>
    public partial class V1PortworxVolumeSource
    {
        /// <summary>
        /// Initializes a new instance of the V1PortworxVolumeSource class.
        /// </summary>
        public V1PortworxVolumeSource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1PortworxVolumeSource class.
        /// </summary>
        /// <param name="volumeID">VolumeID uniquely identifies a Portworx
        /// volume</param>
        /// <param name="fsType">FSType represents the filesystem type to mount
        /// Must be a filesystem type supported by the host operating system.
        /// Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if
        /// unspecified.</param>
        /// <param name="readOnlyProperty">Defaults to false (read/write).
        /// ReadOnly here will force the ReadOnly setting in
        /// VolumeMounts.</param>
        public V1PortworxVolumeSource(string volumeID, string fsType = default(string), bool? readOnlyProperty = default(bool?))
        {
            FsType = fsType;
            ReadOnlyProperty = readOnlyProperty;
            VolumeID = volumeID;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets fSType represents the filesystem type to mount Must be
        /// a filesystem type supported by the host operating system. Ex.
        /// "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified.
        /// </summary>
        [JsonProperty(PropertyName = "fsType")]
        public string FsType { get; set; }

        /// <summary>
        /// Gets or sets defaults to false (read/write). ReadOnly here will
        /// force the ReadOnly setting in VolumeMounts.
        /// </summary>
        [JsonProperty(PropertyName = "readOnly")]
        public bool? ReadOnlyProperty { get; set; }

        /// <summary>
        /// Gets or sets volumeID uniquely identifies a Portworx volume
        /// </summary>
        [JsonProperty(PropertyName = "volumeID")]
        public string VolumeID { get; set; }

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