// <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>
    /// JobTemplateSpec describes the data a Job should have when created from
    /// a template
    /// </summary>
    public partial class V2alpha1JobTemplateSpec
    {
        /// <summary>
        /// Initializes a new instance of the V2alpha1JobTemplateSpec class.
        /// </summary>
        public V2alpha1JobTemplateSpec()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V2alpha1JobTemplateSpec class.
        /// </summary>
        /// <param name="metadata">Standard object's metadata of the jobs
        /// created from this template. More info:
        /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata</param>
        /// <param name="spec">Specification of the desired behavior of the
        /// job. More info:
        /// https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status</param>
        public V2alpha1JobTemplateSpec(V1ObjectMeta metadata = default(V1ObjectMeta), V1JobSpec spec = default(V1JobSpec))
        {
            Metadata = metadata;
            Spec = spec;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets standard object's metadata of the jobs created from
        /// this template. More info:
        /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
        /// </summary>
        [JsonProperty(PropertyName = "metadata")]
        public V1ObjectMeta Metadata { get; set; }

        /// <summary>
        /// Gets or sets specification of the desired behavior of the job. More
        /// info:
        /// https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
        /// </summary>
        [JsonProperty(PropertyName = "spec")]
        public V1JobSpec Spec { get; set; }

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