// <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 Microsoft.Azure.CognitiveServices.Search.AutoSuggest.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    [Newtonsoft.Json.JsonObject("Suggestions/SuggestionGroup")]
    public partial class SuggestionsSuggestionGroup
    {
        /// <summary>
        /// Initializes a new instance of the SuggestionsSuggestionGroup class.
        /// </summary>
        public SuggestionsSuggestionGroup()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the SuggestionsSuggestionGroup class.
        /// </summary>
        /// <param name="name">Possible values include: 'Unknown', 'Web',
        /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments',
        /// 'PersonalSearchTags', 'Custom'</param>
        public SuggestionsSuggestionGroup(string name, IList<SearchAction> searchSuggestions)
        {
            Name = name;
            SearchSuggestions = searchSuggestions;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets possible values include: 'Unknown', 'Web',
        /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments',
        /// 'PersonalSearchTags', 'Custom'
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// </summary>
        [JsonProperty(PropertyName = "searchSuggestions")]
        public IList<SearchAction> SearchSuggestions { get; set; }

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