| | 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 Newtonsoft.Json; |
| | 10 | | using System.Linq; |
| | 11 | |
|
| | 12 | | /// <summary> |
| | 13 | | /// Defines the top-level object that the response includes when the |
| | 14 | | /// request succeeds. |
| | 15 | | /// </summary> |
| | 16 | | public partial class SearchResponse : Response |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Initializes a new instance of the SearchResponse class. |
| | 20 | | /// </summary> |
| 2 | 21 | | public SearchResponse() |
| | 22 | | { |
| | 23 | | CustomInit(); |
| 2 | 24 | | } |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the SearchResponse class. |
| | 28 | | /// </summary> |
| | 29 | | /// <param name="id">A String identifier.</param> |
| | 30 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 31 | | /// item.</param> |
| | 32 | | /// <param name="queryContext">An object that contains the query string |
| | 33 | | /// that Bing used for the request. This object contains the query |
| | 34 | | /// string as entered by the user. It may also contain an altered query |
| | 35 | | /// string that Bing used for the query if the query string contained a |
| | 36 | | /// spelling mistake.</param> |
| | 37 | | /// <param name="webPages">A list of webpages that are relevant to the |
| | 38 | | /// search query.</param> |
| | 39 | | /// <param name="images">A list of images that are relevant to the |
| | 40 | | /// search query.</param> |
| | 41 | | /// <param name="news">A list of news articles that are relevant to the |
| | 42 | | /// search query.</param> |
| | 43 | | /// <param name="relatedSearches">A list of related queries made by |
| | 44 | | /// others.</param> |
| | 45 | | /// <param name="spellSuggestions">The query string that likely |
| | 46 | | /// represents the user's intent.</param> |
| | 47 | | /// <param name="timeZone">The date and time of one or more geographic |
| | 48 | | /// locations.</param> |
| | 49 | | /// <param name="videos">A list of videos that are relevant to the |
| | 50 | | /// search query.</param> |
| | 51 | | /// <param name="computation">The answer to a math expression or units |
| | 52 | | /// conversion expression.</param> |
| | 53 | | /// <param name="rankingResponse">The order that Bing suggests that you |
| | 54 | | /// display the search results in.</param> |
| | 55 | | public SearchResponse(string id = default(string), string webSearchUrl = default(string), QueryContext queryCont |
| 0 | 56 | | : base(id, webSearchUrl) |
| | 57 | | { |
| 0 | 58 | | QueryContext = queryContext; |
| 0 | 59 | | WebPages = webPages; |
| 0 | 60 | | Images = images; |
| 0 | 61 | | News = news; |
| 0 | 62 | | RelatedSearches = relatedSearches; |
| 0 | 63 | | SpellSuggestions = spellSuggestions; |
| 0 | 64 | | TimeZone = timeZone; |
| 0 | 65 | | Videos = videos; |
| 0 | 66 | | Computation = computation; |
| 0 | 67 | | RankingResponse = rankingResponse; |
| | 68 | | CustomInit(); |
| 0 | 69 | | } |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// An initialization method that performs custom operations like setting defaults |
| | 73 | | /// </summary> |
| | 74 | | partial void CustomInit(); |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets an object that contains the query string that Bing used for |
| | 78 | | /// the request. This object contains the query string as entered by |
| | 79 | | /// the user. It may also contain an altered query string that Bing |
| | 80 | | /// used for the query if the query string contained a spelling |
| | 81 | | /// mistake. |
| | 82 | | /// </summary> |
| | 83 | | [JsonProperty(PropertyName = "queryContext")] |
| 0 | 84 | | public QueryContext QueryContext { get; private set; } |
| | 85 | |
|
| | 86 | | /// <summary> |
| | 87 | | /// Gets a list of webpages that are relevant to the search query. |
| | 88 | | /// </summary> |
| | 89 | | [JsonProperty(PropertyName = "webPages")] |
| 10 | 90 | | public WebWebAnswer WebPages { get; private set; } |
| | 91 | |
|
| | 92 | | /// <summary> |
| | 93 | | /// Gets a list of images that are relevant to the search query. |
| | 94 | | /// </summary> |
| | 95 | | [JsonProperty(PropertyName = "images")] |
| 10 | 96 | | public Images Images { get; private set; } |
| | 97 | |
|
| | 98 | | /// <summary> |
| | 99 | | /// Gets a list of news articles that are relevant to the search query. |
| | 100 | | /// </summary> |
| | 101 | | [JsonProperty(PropertyName = "news")] |
| 4 | 102 | | public News News { get; private set; } |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// Gets a list of related queries made by others. |
| | 106 | | /// </summary> |
| | 107 | | [JsonProperty(PropertyName = "relatedSearches")] |
| 0 | 108 | | public RelatedSearchesRelatedSearchAnswer RelatedSearches { get; private set; } |
| | 109 | |
|
| | 110 | | /// <summary> |
| | 111 | | /// Gets the query string that likely represents the user's intent. |
| | 112 | | /// </summary> |
| | 113 | | [JsonProperty(PropertyName = "spellSuggestions")] |
| 0 | 114 | | public SpellSuggestions SpellSuggestions { get; private set; } |
| | 115 | |
|
| | 116 | | /// <summary> |
| | 117 | | /// Gets the date and time of one or more geographic locations. |
| | 118 | | /// </summary> |
| | 119 | | [JsonProperty(PropertyName = "timeZone")] |
| 0 | 120 | | public TimeZone TimeZone { get; private set; } |
| | 121 | |
|
| | 122 | | /// <summary> |
| | 123 | | /// Gets a list of videos that are relevant to the search query. |
| | 124 | | /// </summary> |
| | 125 | | [JsonProperty(PropertyName = "videos")] |
| 4 | 126 | | public Videos Videos { get; private set; } |
| | 127 | |
|
| | 128 | | /// <summary> |
| | 129 | | /// Gets the answer to a math expression or units conversion |
| | 130 | | /// expression. |
| | 131 | | /// </summary> |
| | 132 | | [JsonProperty(PropertyName = "computation")] |
| 0 | 133 | | public Computation Computation { get; private set; } |
| | 134 | |
|
| | 135 | | /// <summary> |
| | 136 | | /// Gets the order that Bing suggests that you display the search |
| | 137 | | /// results in. |
| | 138 | | /// </summary> |
| | 139 | | [JsonProperty(PropertyName = "rankingResponse")] |
| 0 | 140 | | public RankingRankingResponse RankingResponse { get; private set; } |
| | 141 | |
|
| | 142 | | /// <summary> |
| | 143 | | /// Validate the object. |
| | 144 | | /// </summary> |
| | 145 | | /// <exception cref="Rest.ValidationException"> |
| | 146 | | /// Thrown if validation fails |
| | 147 | | /// </exception> |
| | 148 | | public virtual void Validate() |
| | 149 | | { |
| 0 | 150 | | if (QueryContext != null) |
| | 151 | | { |
| 0 | 152 | | QueryContext.Validate(); |
| | 153 | | } |
| 0 | 154 | | if (WebPages != null) |
| | 155 | | { |
| 0 | 156 | | WebPages.Validate(); |
| | 157 | | } |
| 0 | 158 | | if (Images != null) |
| | 159 | | { |
| 0 | 160 | | Images.Validate(); |
| | 161 | | } |
| 0 | 162 | | if (News != null) |
| | 163 | | { |
| 0 | 164 | | News.Validate(); |
| | 165 | | } |
| 0 | 166 | | if (RelatedSearches != null) |
| | 167 | | { |
| 0 | 168 | | RelatedSearches.Validate(); |
| | 169 | | } |
| 0 | 170 | | if (SpellSuggestions != null) |
| | 171 | | { |
| 0 | 172 | | SpellSuggestions.Validate(); |
| | 173 | | } |
| 0 | 174 | | if (TimeZone != null) |
| | 175 | | { |
| 0 | 176 | | TimeZone.Validate(); |
| | 177 | | } |
| 0 | 178 | | if (Videos != null) |
| | 179 | | { |
| 0 | 180 | | Videos.Validate(); |
| | 181 | | } |
| 0 | 182 | | if (Computation != null) |
| | 183 | | { |
| 0 | 184 | | Computation.Validate(); |
| | 185 | | } |
| 0 | 186 | | if (RankingResponse != null) |
| | 187 | | { |
| 0 | 188 | | RankingResponse.Validate(); |
| | 189 | | } |
| 0 | 190 | | } |
| | 191 | | } |
| | 192 | | } |