| | | 1 | | // <auto-generated> |
| | | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 4 | | // regenerated. |
| | | 5 | | // </auto-generated> |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Azure.CognitiveServices.Search.AutoSuggest.Models |
| | | 8 | | { |
| | | 9 | | using Microsoft.Rest; |
| | | 10 | | using Newtonsoft.Json; |
| | | 11 | | using System.Collections; |
| | | 12 | | using System.Collections.Generic; |
| | | 13 | | using System.Linq; |
| | | 14 | | |
| | | 15 | | [Newtonsoft.Json.JsonObject("Suggestions/SuggestionGroup")] |
| | | 16 | | public partial class SuggestionsSuggestionGroup |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// Initializes a new instance of the SuggestionsSuggestionGroup class. |
| | | 20 | | /// </summary> |
| | 2 | 21 | | public SuggestionsSuggestionGroup() |
| | | 22 | | { |
| | | 23 | | CustomInit(); |
| | 2 | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Initializes a new instance of the SuggestionsSuggestionGroup class. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <param name="name">Possible values include: 'Unknown', 'Web', |
| | | 30 | | /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', |
| | | 31 | | /// 'PersonalSearchTags', 'Custom'</param> |
| | 0 | 32 | | public SuggestionsSuggestionGroup(string name, IList<SearchAction> searchSuggestions) |
| | | 33 | | { |
| | 0 | 34 | | Name = name; |
| | 0 | 35 | | SearchSuggestions = searchSuggestions; |
| | | 36 | | CustomInit(); |
| | 0 | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// An initialization method that performs custom operations like setting defaults |
| | | 41 | | /// </summary> |
| | | 42 | | partial void CustomInit(); |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Gets or sets possible values include: 'Unknown', 'Web', |
| | | 46 | | /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', |
| | | 47 | | /// 'PersonalSearchTags', 'Custom' |
| | | 48 | | /// </summary> |
| | | 49 | | [JsonProperty(PropertyName = "name")] |
| | 0 | 50 | | public string Name { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// </summary> |
| | | 54 | | [JsonProperty(PropertyName = "searchSuggestions")] |
| | 4 | 55 | | public IList<SearchAction> SearchSuggestions { get; set; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Validate the object. |
| | | 59 | | /// </summary> |
| | | 60 | | /// <exception cref="ValidationException"> |
| | | 61 | | /// Thrown if validation fails |
| | | 62 | | /// </exception> |
| | | 63 | | public virtual void Validate() |
| | | 64 | | { |
| | 0 | 65 | | if (Name == null) |
| | | 66 | | { |
| | 0 | 67 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | | 68 | | } |
| | 0 | 69 | | if (SearchSuggestions == null) |
| | | 70 | | { |
| | 0 | 71 | | throw new ValidationException(ValidationRules.CannotBeNull, "SearchSuggestions"); |
| | | 72 | | } |
| | 0 | 73 | | } |
| | | 74 | | } |
| | | 75 | | } |