// <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>
    /// Represents a cinder volume resource in Openstack. A Cinder volume must
    /// exist before mounting to a container. The volume must also be in the
    /// same region as the kubelet. Cinder volumes support ownership management
    /// and SELinux relabeling.
    /// </summary>
    public partial class V1CinderPersistentVolumeSource
    {
        /// <summary>
        /// Initializes a new instance of the V1CinderPersistentVolumeSource
        /// class.
        /// </summary>
        public V1CinderPersistentVolumeSource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1CinderPersistentVolumeSource
        /// class.
        /// </summary>
        /// <param name="volumeID">volume id used to identify the volume in
        /// cinder. More info:
        /// https://examples.k8s.io/mysql-cinder-pd/README.md</param>
        /// <param name="fsType">Filesystem type to mount. Must be a filesystem
        /// type supported by the host operating system. Examples: "ext4",
        /// "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
        /// More info:
        /// https://examples.k8s.io/mysql-cinder-pd/README.md</param>
        /// <param name="readOnlyProperty">Optional: Defaults to false
        /// (read/write). ReadOnly here will force the ReadOnly setting in
        /// VolumeMounts. More info:
        /// https://examples.k8s.io/mysql-cinder-pd/README.md</param>
        /// <param name="secretRef">Optional: points to a secret object
        /// containing parameters used to connect to OpenStack.</param>
        public V1CinderPersistentVolumeSource(string volumeID, string fsType = default(string), bool? readOnlyProperty = default(bool?), V1SecretReference secretRef = default(V1SecretReference))
        {
            FsType = fsType;
            ReadOnlyProperty = readOnlyProperty;
            SecretRef = secretRef;
            VolumeID = volumeID;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets filesystem type to mount. Must be a filesystem type
        /// supported by the host operating system. Examples: "ext4", "xfs",
        /// "ntfs". Implicitly inferred to be "ext4" if unspecified. More info:
        /// https://examples.k8s.io/mysql-cinder-pd/README.md
        /// </summary>
        [JsonProperty(PropertyName = "fsType")]
        public string FsType { get; set; }

        /// <summary>
        /// Gets or sets optional: Defaults to false (read/write). ReadOnly
        /// here will force the ReadOnly setting in VolumeMounts. More info:
        /// https://examples.k8s.io/mysql-cinder-pd/README.md
        /// </summary>
        [JsonProperty(PropertyName = "readOnly")]
        public bool? ReadOnlyProperty { get; set; }

        /// <summary>
        /// Gets or sets optional: points to a secret object containing
        /// parameters used to connect to OpenStack.
        /// </summary>
        [JsonProperty(PropertyName = "secretRef")]
        public V1SecretReference SecretRef { get; set; }

        /// <summary>
        /// Gets or sets volume id used to identify the volume in cinder. More
        /// info: https://examples.k8s.io/mysql-cinder-pd/README.md
        /// </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");
            }
        }
    }
}
