| | 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.WebSearch.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 | | /// <summary> |
| | 16 | | /// Defines a suggested query string that likely represents the user's |
| | 17 | | /// intent. The search results include this response if Bing determines |
| | 18 | | /// that the user may have intended to search for something different. For |
| | 19 | | /// example, if the user searches for alon brown, Bing may determine that |
| | 20 | | /// the user likely intended to search for Alton Brown instead (based on |
| | 21 | | /// past searches by others of Alon Brown). |
| | 22 | | /// </summary> |
| | 23 | | public partial class SpellSuggestions : SearchResultsAnswer |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Initializes a new instance of the SpellSuggestions class. |
| | 27 | | /// </summary> |
| 0 | 28 | | public SpellSuggestions() |
| | 29 | | { |
| | 30 | | CustomInit(); |
| 0 | 31 | | } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Initializes a new instance of the SpellSuggestions class. |
| | 35 | | /// </summary> |
| | 36 | | /// <param name="value">A list of suggested query strings that may |
| | 37 | | /// represent the user's intention. The list contains only one Query |
| | 38 | | /// object.</param> |
| | 39 | | /// <param name="id">A String identifier.</param> |
| | 40 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 41 | | /// item.</param> |
| | 42 | | /// <param name="totalEstimatedMatches">The estimated number of |
| | 43 | | /// webpages that are relevant to the query. Use this number along with |
| | 44 | | /// the count and offset query parameters to page the results.</param> |
| | 45 | | public SpellSuggestions(IList<Query> value, string id = default(string), string webSearchUrl = default(string), |
| 0 | 46 | | : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly) |
| | 47 | | { |
| 0 | 48 | | Value = value; |
| | 49 | | CustomInit(); |
| 0 | 50 | | } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// An initialization method that performs custom operations like setting defaults |
| | 54 | | /// </summary> |
| | 55 | | partial void CustomInit(); |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets or sets a list of suggested query strings that may represent |
| | 59 | | /// the user's intention. The list contains only one Query object. |
| | 60 | | /// </summary> |
| | 61 | | [JsonProperty(PropertyName = "value")] |
| 0 | 62 | | public IList<Query> Value { get; set; } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// Validate the object. |
| | 66 | | /// </summary> |
| | 67 | | /// <exception cref="ValidationException"> |
| | 68 | | /// Thrown if validation fails |
| | 69 | | /// </exception> |
| | 70 | | public override void Validate() |
| | 71 | | { |
| 0 | 72 | | base.Validate(); |
| 0 | 73 | | if (Value == null) |
| | 74 | | { |
| 0 | 75 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 76 | | } |
| 0 | 77 | | if (Value != null) |
| | 78 | | { |
| 0 | 79 | | foreach (var element in Value) |
| | 80 | | { |
| 0 | 81 | | if (element != null) |
| | 82 | | { |
| 0 | 83 | | element.Validate(); |
| | 84 | | } |
| | 85 | | } |
| | 86 | | } |
| 0 | 87 | | } |
| | 88 | | } |
| | 89 | | } |