// 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.

namespace Microsoft.Azure.Management.DataFactory.Models
{
    using Microsoft.Azure;
    using Microsoft.Azure.Management;
    using Microsoft.Azure.Management.DataFactory;
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Activity dependency information.
    /// </summary>
    public partial class ActivityDependency
    {
        /// <summary>
        /// Initializes a new instance of the ActivityDependency class.
        /// </summary>
        public ActivityDependency()
        {
          CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ActivityDependency class.
        /// </summary>
        /// <param name="activity">Activity name.</param>
        /// <param name="dependencyConditions">Match-Condition for the
        /// dependency.</param>
        public ActivityDependency(string activity, IList<string> dependencyConditions)
        {
            Activity = activity;
            DependencyConditions = dependencyConditions;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets activity name.
        /// </summary>
        [JsonProperty(PropertyName = "activity")]
        public string Activity { get; set; }

        /// <summary>
        /// Gets or sets match-Condition for the dependency.
        /// </summary>
        [JsonProperty(PropertyName = "dependencyConditions")]
        public IList<string> DependencyConditions { get; set; }

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