| | 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.CustomSearch.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 | | public SearchResponse(string id = default(string), string webSearchUrl = default(string), QueryContext queryCont |
| 0 | 40 | | : base(id, webSearchUrl) |
| | 41 | | { |
| 0 | 42 | | QueryContext = queryContext; |
| 0 | 43 | | WebPages = webPages; |
| | 44 | | CustomInit(); |
| 0 | 45 | | } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// An initialization method that performs custom operations like setting defaults |
| | 49 | | /// </summary> |
| | 50 | | partial void CustomInit(); |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Gets an object that contains the query string that Bing used for |
| | 54 | | /// the request. This object contains the query string as entered by |
| | 55 | | /// the user. It may also contain an altered query string that Bing |
| | 56 | | /// used for the query if the query string contained a spelling |
| | 57 | | /// mistake. |
| | 58 | | /// </summary> |
| | 59 | | [JsonProperty(PropertyName = "queryContext")] |
| 0 | 60 | | public QueryContext QueryContext { get; private set; } |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Gets a list of webpages that are relevant to the search query. |
| | 64 | | /// </summary> |
| | 65 | | [JsonProperty(PropertyName = "webPages")] |
| 10 | 66 | | public WebWebAnswer WebPages { get; private set; } |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Validate the object. |
| | 70 | | /// </summary> |
| | 71 | | /// <exception cref="Rest.ValidationException"> |
| | 72 | | /// Thrown if validation fails |
| | 73 | | /// </exception> |
| | 74 | | public virtual void Validate() |
| | 75 | | { |
| 0 | 76 | | if (QueryContext != null) |
| | 77 | | { |
| 0 | 78 | | QueryContext.Validate(); |
| | 79 | | } |
| 0 | 80 | | if (WebPages != null) |
| | 81 | | { |
| 0 | 82 | | WebPages.Validate(); |
| | 83 | | } |
| 0 | 84 | | } |
| | 85 | | } |
| | 86 | | } |