// <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 an NFS mount that lasts the lifetime of a pod. NFS volumes
    /// do not support ownership management or SELinux relabeling.
    /// </summary>
    public partial class V1NFSVolumeSource
    {
        /// <summary>
        /// Initializes a new instance of the V1NFSVolumeSource class.
        /// </summary>
        public V1NFSVolumeSource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1NFSVolumeSource class.
        /// </summary>
        /// <param name="path">Path that is exported by the NFS server. More
        /// info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs</param>
        /// <param name="server">Server is the hostname or IP address of the
        /// NFS server. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs</param>
        /// <param name="readOnlyProperty">ReadOnly here will force the NFS
        /// export to be mounted with read-only permissions. Defaults to false.
        /// More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs</param>
        public V1NFSVolumeSource(string path, string server, bool? readOnlyProperty = default(bool?))
        {
            Path = path;
            ReadOnlyProperty = readOnlyProperty;
            Server = server;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets path that is exported by the NFS server. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs
        /// </summary>
        [JsonProperty(PropertyName = "path")]
        public string Path { get; set; }

        /// <summary>
        /// Gets or sets readOnly here will force the NFS export to be mounted
        /// with read-only permissions. Defaults to false. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs
        /// </summary>
        [JsonProperty(PropertyName = "readOnly")]
        public bool? ReadOnlyProperty { get; set; }

        /// <summary>
        /// Gets or sets server is the hostname or IP address of the NFS
        /// server. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs
        /// </summary>
        [JsonProperty(PropertyName = "server")]
        public string Server { 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");
            }
            if (Server == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Server");
            }
        }
    }
}
