| | 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.EntitySearch.Models |
| | 8 | | { |
| | 9 | | using Newtonsoft.Json; |
| | 10 | | using System.Collections; |
| | 11 | | using System.Collections.Generic; |
| | 12 | | using System.Linq; |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Defines the top-level object that the response includes when the |
| | 16 | | /// request succeeds. |
| | 17 | | /// </summary> |
| | 18 | | public partial class SearchResponse : Response |
| | 19 | | { |
| | 20 | | /// <summary> |
| | 21 | | /// Initializes a new instance of the SearchResponse class. |
| | 22 | | /// </summary> |
| 2 | 23 | | public SearchResponse() |
| | 24 | | { |
| | 25 | | CustomInit(); |
| 2 | 26 | | } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Initializes a new instance of the SearchResponse class. |
| | 30 | | /// </summary> |
| | 31 | | /// <param name="id">A String identifier.</param> |
| | 32 | | /// <param name="contractualRules">A list of rules that you must adhere |
| | 33 | | /// to if you display the item.</param> |
| | 34 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 35 | | /// item.</param> |
| | 36 | | /// <param name="queryContext">An object that contains the query string |
| | 37 | | /// that Bing used for the request. This object contains the query |
| | 38 | | /// string as entered by the user. It may also contain an altered query |
| | 39 | | /// string that Bing used for the query if the query string contained a |
| | 40 | | /// spelling mistake.</param> |
| | 41 | | /// <param name="entities">A list of entities that are relevant to the |
| | 42 | | /// search query.</param> |
| | 43 | | /// <param name="places">A list of local entities such as restaurants |
| | 44 | | /// or hotels that are relevant to the query.</param> |
| | 45 | | public SearchResponse(string id = default(string), IList<ContractualRulesContractualRule> contractualRules = def |
| 0 | 46 | | : base(id, contractualRules, webSearchUrl) |
| | 47 | | { |
| 0 | 48 | | QueryContext = queryContext; |
| 0 | 49 | | Entities = entities; |
| 0 | 50 | | Places = places; |
| | 51 | | CustomInit(); |
| 0 | 52 | | } |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// An initialization method that performs custom operations like setting defaults |
| | 56 | | /// </summary> |
| | 57 | | partial void CustomInit(); |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets an object that contains the query string that Bing used for |
| | 61 | | /// the request. This object contains the query string as entered by |
| | 62 | | /// the user. It may also contain an altered query string that Bing |
| | 63 | | /// used for the query if the query string contained a spelling |
| | 64 | | /// mistake. |
| | 65 | | /// </summary> |
| | 66 | | [JsonProperty(PropertyName = "queryContext")] |
| 0 | 67 | | public QueryContext QueryContext { get; private set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Gets a list of entities that are relevant to the search query. |
| | 71 | | /// </summary> |
| | 72 | | [JsonProperty(PropertyName = "entities")] |
| 14 | 73 | | public Entities Entities { get; private set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Gets a list of local entities such as restaurants or hotels that |
| | 77 | | /// are relevant to the query. |
| | 78 | | /// </summary> |
| | 79 | | [JsonProperty(PropertyName = "places")] |
| 0 | 80 | | public Places Places { get; private set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Validate the object. |
| | 84 | | /// </summary> |
| | 85 | | /// <exception cref="Rest.ValidationException"> |
| | 86 | | /// Thrown if validation fails |
| | 87 | | /// </exception> |
| | 88 | | public virtual void Validate() |
| | 89 | | { |
| 0 | 90 | | if (QueryContext != null) |
| | 91 | | { |
| 0 | 92 | | QueryContext.Validate(); |
| | 93 | | } |
| 0 | 94 | | if (Entities != null) |
| | 95 | | { |
| 0 | 96 | | Entities.Validate(); |
| | 97 | | } |
| 0 | 98 | | if (Places != null) |
| | 99 | | { |
| 0 | 100 | | Places.Validate(); |
| | 101 | | } |
| 0 | 102 | | } |
| | 103 | | } |
| | 104 | | } |