| | 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 an image answer |
| | 17 | | /// </summary> |
| | 18 | | public partial class Images : SearchResultsAnswer |
| | 19 | | { |
| | 20 | | /// <summary> |
| | 21 | | /// Initializes a new instance of the Images class. |
| | 22 | | /// </summary> |
| 2 | 23 | | public Images() |
| | 24 | | { |
| | 25 | | CustomInit(); |
| 2 | 26 | | } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Initializes a new instance of the Images class. |
| | 30 | | /// </summary> |
| | 31 | | /// <param name="value">A list of image objects that are relevant to |
| | 32 | | /// the query. If there are no results, the List is empty.</param> |
| | 33 | | /// <param name="id">A String identifier.</param> |
| | 34 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 35 | | /// item.</param> |
| | 36 | | /// <param name="totalEstimatedMatches">The estimated number of |
| | 37 | | /// webpages that are relevant to the query. Use this number along with |
| | 38 | | /// the count and offset query parameters to page the results.</param> |
| | 39 | | public Images(IList<ImageObject> value, string id = default(string), string webSearchUrl = default(string), ILis |
| 0 | 40 | | : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly) |
| | 41 | | { |
| 0 | 42 | | NextOffset = nextOffset; |
| 0 | 43 | | Value = value; |
| 0 | 44 | | QueryExpansions = queryExpansions; |
| 0 | 45 | | SimilarTerms = similarTerms; |
| 0 | 46 | | RelatedSearches = relatedSearches; |
| | 47 | | CustomInit(); |
| 0 | 48 | | } |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// An initialization method that performs custom operations like setting defaults |
| | 52 | | /// </summary> |
| | 53 | | partial void CustomInit(); |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// </summary> |
| | 57 | | [JsonProperty(PropertyName = "nextOffset")] |
| 0 | 58 | | public int? NextOffset { get; private set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Gets or sets a list of image objects that are relevant to the |
| | 62 | | /// query. If there are no results, the List is empty. |
| | 63 | | /// </summary> |
| | 64 | | [JsonProperty(PropertyName = "value")] |
| 8 | 65 | | public IList<ImageObject> Value { get; set; } |
| | 66 | |
|
| | 67 | | /// <summary> |
| | 68 | | /// </summary> |
| | 69 | | [JsonProperty(PropertyName = "queryExpansions")] |
| 0 | 70 | | public IList<Query> QueryExpansions { get; private set; } |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// </summary> |
| | 74 | | [JsonProperty(PropertyName = "similarTerms")] |
| 0 | 75 | | public IList<Query> SimilarTerms { get; private set; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// </summary> |
| | 79 | | [JsonProperty(PropertyName = "relatedSearches")] |
| 0 | 80 | | public IList<Query> RelatedSearches { get; private set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Validate the object. |
| | 84 | | /// </summary> |
| | 85 | | /// <exception cref="ValidationException"> |
| | 86 | | /// Thrown if validation fails |
| | 87 | | /// </exception> |
| | 88 | | public override void Validate() |
| | 89 | | { |
| 0 | 90 | | base.Validate(); |
| 0 | 91 | | if (Value == null) |
| | 92 | | { |
| 0 | 93 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 94 | | } |
| 0 | 95 | | if (QueryExpansions != null) |
| | 96 | | { |
| 0 | 97 | | foreach (var element in QueryExpansions) |
| | 98 | | { |
| 0 | 99 | | if (element != null) |
| | 100 | | { |
| 0 | 101 | | element.Validate(); |
| | 102 | | } |
| | 103 | | } |
| | 104 | | } |
| 0 | 105 | | if (SimilarTerms != null) |
| | 106 | | { |
| 0 | 107 | | foreach (var element1 in SimilarTerms) |
| | 108 | | { |
| 0 | 109 | | if (element1 != null) |
| | 110 | | { |
| 0 | 111 | | element1.Validate(); |
| | 112 | | } |
| | 113 | | } |
| | 114 | | } |
| 0 | 115 | | if (RelatedSearches != null) |
| | 116 | | { |
| 0 | 117 | | foreach (var element2 in RelatedSearches) |
| | 118 | | { |
| 0 | 119 | | if (element2 != null) |
| | 120 | | { |
| 0 | 121 | | element2.Validate(); |
| | 122 | | } |
| | 123 | | } |
| | 124 | | } |
| 0 | 125 | | } |
| | 126 | | } |
| | 127 | | } |