// <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 Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// LimitedPriorityLevelConfiguration specifies how to handle requests that
    /// are subject to limits. It addresses two issues:
    /// * How are requests for this priority level limited?
    /// * What should be done with requests that exceed the limit?
    /// </summary>
    public partial class V1beta1LimitedPriorityLevelConfiguration
    {
        /// <summary>
        /// Initializes a new instance of the
        /// V1beta1LimitedPriorityLevelConfiguration class.
        /// </summary>
        public V1beta1LimitedPriorityLevelConfiguration()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// V1beta1LimitedPriorityLevelConfiguration class.
        /// </summary>
        /// <param name="assuredConcurrencyShares">`assuredConcurrencyShares`
        /// (ACS) configures the execution limit, which is a limit on the
        /// number of requests of this priority level that may be exeucting at
        /// a given time.  ACS must be a positive number. The server's
        /// concurrency limit (SCL) is divided among the concurrency-controlled
        /// priority levels in proportion to their assured concurrency shares.
        /// This produces the assured concurrency value (ACV) --- the number of
        /// requests that may be executing at a time --- for each such priority
        /// level:
        ///
        /// ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
        ///
        /// bigger numbers of ACS mean more reserved concurrent requests (at
        /// the expense of every other PL). This field has a default value of
        /// 30.</param>
        /// <param name="limitResponse">`limitResponse` indicates what to do
        /// with requests that can not be executed right now</param>
        public V1beta1LimitedPriorityLevelConfiguration(int? assuredConcurrencyShares = default(int?), V1beta1LimitResponse limitResponse = default(V1beta1LimitResponse))
        {
            AssuredConcurrencyShares = assuredConcurrencyShares;
            LimitResponse = limitResponse;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets `assuredConcurrencyShares` (ACS) configures the
        /// execution limit, which is a limit on the number of requests of this
        /// priority level that may be exeucting at a given time.  ACS must be
        /// a positive number. The server's concurrency limit (SCL) is divided
        /// among the concurrency-controlled priority levels in proportion to
        /// their assured concurrency shares. This produces the assured
        /// concurrency value (ACV) --- the number of requests that may be
        /// executing at a time --- for each such priority level:
        ///
        /// ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
        ///
        /// bigger numbers of ACS mean more reserved concurrent requests (at
        /// the expense of every other PL). This field has a default value of
        /// 30.
        /// </summary>
        [JsonProperty(PropertyName = "assuredConcurrencyShares")]
        public int? AssuredConcurrencyShares { get; set; }

        /// <summary>
        /// Gets or sets `limitResponse` indicates what to do with requests
        /// that can not be executed right now
        /// </summary>
        [JsonProperty(PropertyName = "limitResponse")]
        public V1beta1LimitResponse LimitResponse { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (LimitResponse != null)
            {
                LimitResponse.Validate();
            }
        }
    }
}
