// <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.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// NonResourceRule holds information that describes a rule for the
    /// non-resource
    /// </summary>
    public partial class V1NonResourceRule
    {
        /// <summary>
        /// Initializes a new instance of the V1NonResourceRule class.
        /// </summary>
        public V1NonResourceRule()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1NonResourceRule class.
        /// </summary>
        /// <param name="verbs">Verb is a list of kubernetes non-resource API
        /// verbs, like: get, post, put, delete, patch, head, options.  "*"
        /// means all.</param>
        /// <param name="nonResourceURLs">NonResourceURLs is a set of partial
        /// urls that a user should have access to.  *s are allowed, but only
        /// as the full, final step in the path.  "*" means all.</param>
        public V1NonResourceRule(IList<string> verbs, IList<string> nonResourceURLs = default(IList<string>))
        {
            NonResourceURLs = nonResourceURLs;
            Verbs = verbs;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets nonResourceURLs is a set of partial urls that a user
        /// should have access to.  *s are allowed, but only as the full, final
        /// step in the path.  "*" means all.
        /// </summary>
        [JsonProperty(PropertyName = "nonResourceURLs")]
        public IList<string> NonResourceURLs { get; set; }

        /// <summary>
        /// Gets or sets verb is a list of kubernetes non-resource API verbs,
        /// like: get, post, put, delete, patch, head, options.  "*" means all.
        /// </summary>
        [JsonProperty(PropertyName = "verbs")]
        public IList<string> Verbs { get; set; }

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