| | 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 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 local entity answer. |
| | 17 | | /// </summary> |
| | 18 | | public partial class Places : SearchResultsAnswer |
| | 19 | | { |
| | 20 | | /// <summary> |
| | 21 | | /// Initializes a new instance of the Places class. |
| | 22 | | /// </summary> |
| 0 | 23 | | public Places() |
| | 24 | | { |
| | 25 | | CustomInit(); |
| 0 | 26 | | } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Initializes a new instance of the Places class. |
| | 30 | | /// </summary> |
| | 31 | | /// <param name="value">A list of local entities, such as restaurants |
| | 32 | | /// or hotels.</param> |
| | 33 | | /// <param name="id">A String identifier.</param> |
| | 34 | | /// <param name="contractualRules">A list of rules that you must adhere |
| | 35 | | /// to if you display the item.</param> |
| | 36 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 37 | | /// item.</param> |
| | 38 | | public Places(IList<Thing> value, string id = default(string), IList<ContractualRulesContractualRule> contractua |
| 0 | 39 | | : base(id, contractualRules, webSearchUrl, queryContext) |
| | 40 | | { |
| 0 | 41 | | Value = value; |
| | 42 | | CustomInit(); |
| 0 | 43 | | } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// An initialization method that performs custom operations like setting defaults |
| | 47 | | /// </summary> |
| | 48 | | partial void CustomInit(); |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Gets or sets a list of local entities, such as restaurants or |
| | 52 | | /// hotels. |
| | 53 | | /// </summary> |
| | 54 | | [JsonProperty(PropertyName = "value")] |
| 0 | 55 | | public IList<Thing> Value { get; set; } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Validate the object. |
| | 59 | | /// </summary> |
| | 60 | | /// <exception cref="ValidationException"> |
| | 61 | | /// Thrown if validation fails |
| | 62 | | /// </exception> |
| | 63 | | public override void Validate() |
| | 64 | | { |
| 0 | 65 | | base.Validate(); |
| 0 | 66 | | if (Value == null) |
| | 67 | | { |
| 0 | 68 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 69 | | } |
| 0 | 70 | | if (Value != null) |
| | 71 | | { |
| 0 | 72 | | foreach (var element in Value) |
| | 73 | | { |
| 0 | 74 | | if (element != null) |
| | 75 | | { |
| 0 | 76 | | element.Validate(); |
| | 77 | | } |
| | 78 | | } |
| | 79 | | } |
| 0 | 80 | | } |
| | 81 | | } |
| | 82 | | } |