| | 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 list of related queries made by others. |
| | 17 | | /// </summary> |
| | 18 | | [Newtonsoft.Json.JsonObject("RelatedSearches/RelatedSearchAnswer")] |
| | 19 | | public partial class RelatedSearchesRelatedSearchAnswer : SearchResultsAnswer |
| | 20 | | { |
| | 21 | | /// <summary> |
| | 22 | | /// Initializes a new instance of the |
| | 23 | | /// RelatedSearchesRelatedSearchAnswer class. |
| | 24 | | /// </summary> |
| 0 | 25 | | public RelatedSearchesRelatedSearchAnswer() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the |
| | 32 | | /// RelatedSearchesRelatedSearchAnswer class. |
| | 33 | | /// </summary> |
| | 34 | | /// <param name="value">A list of related queries that were made by |
| | 35 | | /// others.</param> |
| | 36 | | /// <param name="id">A String identifier.</param> |
| | 37 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 38 | | /// item.</param> |
| | 39 | | /// <param name="totalEstimatedMatches">The estimated number of |
| | 40 | | /// webpages that are relevant to the query. Use this number along with |
| | 41 | | /// the count and offset query parameters to page the results.</param> |
| | 42 | | public RelatedSearchesRelatedSearchAnswer(IList<Query> value, string id = default(string), string webSearchUrl = |
| 0 | 43 | | : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly) |
| | 44 | | { |
| 0 | 45 | | Value = value; |
| | 46 | | CustomInit(); |
| 0 | 47 | | } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// An initialization method that performs custom operations like setting defaults |
| | 51 | | /// </summary> |
| | 52 | | partial void CustomInit(); |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Gets or sets a list of related queries that were made by others. |
| | 56 | | /// </summary> |
| | 57 | | [JsonProperty(PropertyName = "value")] |
| 0 | 58 | | public IList<Query> Value { get; set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Validate the object. |
| | 62 | | /// </summary> |
| | 63 | | /// <exception cref="ValidationException"> |
| | 64 | | /// Thrown if validation fails |
| | 65 | | /// </exception> |
| | 66 | | public override void Validate() |
| | 67 | | { |
| 0 | 68 | | base.Validate(); |
| 0 | 69 | | if (Value == null) |
| | 70 | | { |
| 0 | 71 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 72 | | } |
| 0 | 73 | | if (Value != null) |
| | 74 | | { |
| 0 | 75 | | foreach (var element in Value) |
| | 76 | | { |
| 0 | 77 | | if (element != null) |
| | 78 | | { |
| 0 | 79 | | element.Validate(); |
| | 80 | | } |
| | 81 | | } |
| | 82 | | } |
| 0 | 83 | | } |
| | 84 | | } |
| | 85 | | } |