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

    /// <summary>
    /// NodeSpec describes the attributes that a node is created with.
    /// </summary>
    public partial class V1NodeSpec
    {
        /// <summary>
        /// Initializes a new instance of the V1NodeSpec class.
        /// </summary>
        public V1NodeSpec()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1NodeSpec class.
        /// </summary>
        /// <param name="configSource">If specified, the source to get node
        /// configuration from The DynamicKubeletConfig feature gate must be
        /// enabled for the Kubelet to use this field</param>
        /// <param name="externalID">Deprecated. Not all kubelets will set this
        /// field. Remove field after 1.13. see:
        /// https://issues.k8s.io/61966</param>
        /// <param name="podCIDR">PodCIDR represents the pod IP range assigned
        /// to the node.</param>
        /// <param name="providerID">ID of the node assigned by the cloud
        /// provider in the format:
        /// &lt;ProviderName&gt;://&lt;ProviderSpecificNodeID&gt;</param>
        /// <param name="taints">If specified, the node's taints.</param>
        /// <param name="unschedulable">Unschedulable controls node
        /// schedulability of new pods. By default, node is schedulable. More
        /// info:
        /// https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration</param>
        public V1NodeSpec(V1NodeConfigSource configSource = default(V1NodeConfigSource), string externalID = default(string), string podCIDR = default(string), string providerID = default(string), IList<V1Taint> taints = default(IList<V1Taint>), bool? unschedulable = default(bool?))
        {
            ConfigSource = configSource;
            ExternalID = externalID;
            PodCIDR = podCIDR;
            ProviderID = providerID;
            Taints = taints;
            Unschedulable = unschedulable;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets if specified, the source to get node configuration
        /// from The DynamicKubeletConfig feature gate must be enabled for the
        /// Kubelet to use this field
        /// </summary>
        [JsonProperty(PropertyName = "configSource")]
        public V1NodeConfigSource ConfigSource { get; set; }

        /// <summary>
        /// Gets or sets deprecated. Not all kubelets will set this field.
        /// Remove field after 1.13. see: https://issues.k8s.io/61966
        /// </summary>
        [JsonProperty(PropertyName = "externalID")]
        public string ExternalID { get; set; }

        /// <summary>
        /// Gets or sets podCIDR represents the pod IP range assigned to the
        /// node.
        /// </summary>
        [JsonProperty(PropertyName = "podCIDR")]
        public string PodCIDR { get; set; }

        /// <summary>
        /// Gets or sets ID of the node assigned by the cloud provider in the
        /// format:
        /// &amp;lt;ProviderName&amp;gt;://&amp;lt;ProviderSpecificNodeID&amp;gt;
        /// </summary>
        [JsonProperty(PropertyName = "providerID")]
        public string ProviderID { get; set; }

        /// <summary>
        /// Gets or sets if specified, the node's taints.
        /// </summary>
        [JsonProperty(PropertyName = "taints")]
        public IList<V1Taint> Taints { get; set; }

        /// <summary>
        /// Gets or sets unschedulable controls node schedulability of new
        /// pods. By default, node is schedulable. More info:
        /// https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration
        /// </summary>
        [JsonProperty(PropertyName = "unschedulable")]
        public bool? Unschedulable { get; set; }

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