// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// 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 Microsoft.Azure.Management.ResourceManager.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Represents a Template Spec artifact.
    /// </summary>
    public partial class TemplateSpecArtifact
    {
        /// <summary>
        /// Initializes a new instance of the TemplateSpecArtifact class.
        /// </summary>
        public TemplateSpecArtifact()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the TemplateSpecArtifact class.
        /// </summary>
        /// <param name="path">A filesystem safe relative path of the
        /// artifact.</param>
        public TemplateSpecArtifact(string path)
        {
            Path = path;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets a filesystem safe relative path of the artifact.
        /// </summary>
        [JsonProperty(PropertyName = "path")]
        public string Path { get; set; }

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