// <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>
    /// PodsMetricStatus indicates the current value of a metric describing
    /// each pod in the current scale target (for example,
    /// transactions-processed-per-second).
    /// </summary>
    public partial class V2beta1PodsMetricStatus
    {
        /// <summary>
        /// Initializes a new instance of the V2beta1PodsMetricStatus class.
        /// </summary>
        public V2beta1PodsMetricStatus()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V2beta1PodsMetricStatus class.
        /// </summary>
        /// <param name="currentAverageValue">currentAverageValue is the
        /// current value of the average of the metric across all relevant pods
        /// (as a quantity)</param>
        /// <param name="metricName">metricName is the name of the metric in
        /// question</param>
        public V2beta1PodsMetricStatus(ResourceQuantity currentAverageValue, string metricName)
        {
            CurrentAverageValue = currentAverageValue;
            MetricName = metricName;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets currentAverageValue is the current value of the
        /// average of the metric across all relevant pods (as a quantity)
        /// </summary>
        [JsonProperty(PropertyName = "currentAverageValue")]
        public ResourceQuantity CurrentAverageValue { get; set; }

        /// <summary>
        /// Gets or sets metricName is the name of the metric in question
        /// </summary>
        [JsonProperty(PropertyName = "metricName")]
        public string MetricName { get; set; }

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