| | 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.ImageSearch.Models |
| | 8 | | { |
| | 9 | | using Microsoft.Rest; |
| | 10 | | using Newtonsoft.Json; |
| | 11 | | using System.Linq; |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Defines an image tile. |
| | 15 | | /// </summary> |
| | 16 | | public partial class TrendingImagesTile |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Initializes a new instance of the TrendingImagesTile class. |
| | 20 | | /// </summary> |
| 170 | 21 | | public TrendingImagesTile() |
| | 22 | | { |
| | 23 | | CustomInit(); |
| 170 | 24 | | } |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the TrendingImagesTile class. |
| | 28 | | /// </summary> |
| | 29 | | /// <param name="query">A query that returns a Bing search results page |
| | 30 | | /// with more images of the subject. For example, if the category is |
| | 31 | | /// Popular People Searches, then the thumbnail is of a popular person. |
| | 32 | | /// The query would return a Bing search results page with more images |
| | 33 | | /// of that person.</param> |
| | 34 | | /// <param name="image">The image's thumbnail.</param> |
| 0 | 35 | | public TrendingImagesTile(Query query, ImageObject image) |
| | 36 | | { |
| 0 | 37 | | Query = query; |
| 0 | 38 | | Image = image; |
| | 39 | | CustomInit(); |
| 0 | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// An initialization method that performs custom operations like setting defaults |
| | 44 | | /// </summary> |
| | 45 | | partial void CustomInit(); |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Gets or sets a query that returns a Bing search results page with |
| | 49 | | /// more images of the subject. For example, if the category is Popular |
| | 50 | | /// People Searches, then the thumbnail is of a popular person. The |
| | 51 | | /// query would return a Bing search results page with more images of |
| | 52 | | /// that person. |
| | 53 | | /// </summary> |
| | 54 | | [JsonProperty(PropertyName = "query")] |
| 342 | 55 | | public Query Query { get; set; } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets or sets the image's thumbnail. |
| | 59 | | /// </summary> |
| | 60 | | [JsonProperty(PropertyName = "image")] |
| 342 | 61 | | public ImageObject Image { get; set; } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Validate the object. |
| | 65 | | /// </summary> |
| | 66 | | /// <exception cref="ValidationException"> |
| | 67 | | /// Thrown if validation fails |
| | 68 | | /// </exception> |
| | 69 | | public virtual void Validate() |
| | 70 | | { |
| 0 | 71 | | if (Query == null) |
| | 72 | | { |
| 0 | 73 | | throw new ValidationException(ValidationRules.CannotBeNull, "Query"); |
| | 74 | | } |
| 0 | 75 | | if (Image == null) |
| | 76 | | { |
| 0 | 77 | | throw new ValidationException(ValidationRules.CannotBeNull, "Image"); |
| | 78 | | } |
| 0 | 79 | | if (Query != null) |
| | 80 | | { |
| 0 | 81 | | Query.Validate(); |
| | 82 | | } |
| 0 | 83 | | } |
| | 84 | | } |
| | 85 | | } |