// <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>
    /// AzureFile represents an Azure File Service mount on the host and bind
    /// mount to the pod.
    /// </summary>
    public partial class V1AzureFileVolumeSource
    {
        /// <summary>
        /// Initializes a new instance of the V1AzureFileVolumeSource class.
        /// </summary>
        public V1AzureFileVolumeSource()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1AzureFileVolumeSource class.
        /// </summary>
        /// <param name="secretName">the name of secret that contains Azure
        /// Storage Account Name and Key</param>
        /// <param name="shareName">Share Name</param>
        /// <param name="readOnlyProperty">Defaults to false (read/write).
        /// ReadOnly here will force the ReadOnly setting in
        /// VolumeMounts.</param>
        public V1AzureFileVolumeSource(string secretName, string shareName, bool? readOnlyProperty = default(bool?))
        {
            ReadOnlyProperty = readOnlyProperty;
            SecretName = secretName;
            ShareName = shareName;
            CustomInit();
        }

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

        /// <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 the name of secret that contains Azure Storage Account
        /// Name and Key
        /// </summary>
        [JsonProperty(PropertyName = "secretName")]
        public string SecretName { get; set; }

        /// <summary>
        /// Gets or sets share Name
        /// </summary>
        [JsonProperty(PropertyName = "shareName")]
        public string ShareName { get; set; }

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