// <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>
    /// ContainerResourceMetricStatus indicates the current value of a resource
    /// metric known to Kubernetes, as specified in requests and limits,
    /// describing a single container in each pod in the current scale target
    /// (e.g. CPU or memory).  Such metrics are built in to Kubernetes, and
    /// have special scaling options on top of those available to normal
    /// per-pod metrics using the "pods" source.
    /// </summary>
    public partial class V2beta2ContainerResourceMetricStatus
    {
        /// <summary>
        /// Initializes a new instance of the
        /// V2beta2ContainerResourceMetricStatus class.
        /// </summary>
        public V2beta2ContainerResourceMetricStatus()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// V2beta2ContainerResourceMetricStatus class.
        /// </summary>
        /// <param name="container">Container is the name of the container in
        /// the pods of the scaling target</param>
        /// <param name="current">current contains the current value for the
        /// given metric</param>
        /// <param name="name">Name is the name of the resource in
        /// question.</param>
        public V2beta2ContainerResourceMetricStatus(string container, V2beta2MetricValueStatus current, string name)
        {
            Container = container;
            Current = current;
            Name = name;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets container is the name of the container in the pods of
        /// the scaling target
        /// </summary>
        [JsonProperty(PropertyName = "container")]
        public string Container { get; set; }

        /// <summary>
        /// Gets or sets current contains the current value for the given
        /// metric
        /// </summary>
        [JsonProperty(PropertyName = "current")]
        public V2beta2MetricValueStatus Current { get; set; }

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

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