| | 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.Collections; |
| | 12 | | using System.Collections.Generic; |
| | 13 | | using System.Linq; |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// The top-level object that the response includes when a trending images |
| | 17 | | /// request succeeds. |
| | 18 | | /// </summary> |
| | 19 | | public partial class TrendingImages : Response |
| | 20 | | { |
| | 21 | | /// <summary> |
| | 22 | | /// Initializes a new instance of the TrendingImages class. |
| | 23 | | /// </summary> |
| 2 | 24 | | public TrendingImages() |
| | 25 | | { |
| | 26 | | CustomInit(); |
| 2 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the TrendingImages class. |
| | 31 | | /// </summary> |
| | 32 | | /// <param name="categories">A list that identifies categories of |
| | 33 | | /// images and a list of trending images in that category.</param> |
| | 34 | | /// <param name="id">A String identifier.</param> |
| | 35 | | /// <param name="readLink">The URL that returns this resource.</param> |
| | 36 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 37 | | /// item.</param> |
| | 38 | | public TrendingImages(IList<TrendingImagesCategory> categories, string id = default(string), string readLink = d |
| 0 | 39 | | : base(id, readLink, webSearchUrl) |
| | 40 | | { |
| 0 | 41 | | Categories = categories; |
| | 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 that identifies categories of images and a list |
| | 52 | | /// of trending images in that category. |
| | 53 | | /// </summary> |
| | 54 | | [JsonProperty(PropertyName = "categories")] |
| 8 | 55 | | public IList<TrendingImagesCategory> Categories { get; set; } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Validate the object. |
| | 59 | | /// </summary> |
| | 60 | | /// <exception cref="ValidationException"> |
| | 61 | | /// Thrown if validation fails |
| | 62 | | /// </exception> |
| | 63 | | public virtual void Validate() |
| | 64 | | { |
| 0 | 65 | | if (Categories == null) |
| | 66 | | { |
| 0 | 67 | | throw new ValidationException(ValidationRules.CannotBeNull, "Categories"); |
| | 68 | | } |
| 0 | 69 | | if (Categories != null) |
| | 70 | | { |
| 0 | 71 | | foreach (var element in Categories) |
| | 72 | | { |
| 0 | 73 | | if (element != null) |
| | 74 | | { |
| 0 | 75 | | element.Validate(); |
| | 76 | | } |
| | 77 | | } |
| | 78 | | } |
| 0 | 79 | | } |
| | 80 | | } |
| | 81 | | } |