| | 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.VideoSearch.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 | | public partial class TrendingVideos : Response |
| | 16 | | { |
| | 17 | | /// <summary> |
| | 18 | | /// Initializes a new instance of the TrendingVideos class. |
| | 19 | | /// </summary> |
| 2 | 20 | | public TrendingVideos() |
| | 21 | | { |
| | 22 | | CustomInit(); |
| 2 | 23 | | } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Initializes a new instance of the TrendingVideos class. |
| | 27 | | /// </summary> |
| | 28 | | /// <param name="id">A String identifier.</param> |
| | 29 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 30 | | /// item.</param> |
| | 31 | | public TrendingVideos(IList<TrendingVideosTile> bannerTiles, IList<TrendingVideosCategory> categories, string id |
| 0 | 32 | | : base(id, webSearchUrl) |
| | 33 | | { |
| 0 | 34 | | BannerTiles = bannerTiles; |
| 0 | 35 | | Categories = categories; |
| | 36 | | CustomInit(); |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// An initialization method that performs custom operations like setting defaults |
| | 41 | | /// </summary> |
| | 42 | | partial void CustomInit(); |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// </summary> |
| | 46 | | [JsonProperty(PropertyName = "bannerTiles")] |
| 8 | 47 | | public IList<TrendingVideosTile> BannerTiles { get; set; } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// </summary> |
| | 51 | | [JsonProperty(PropertyName = "categories")] |
| 8 | 52 | | public IList<TrendingVideosCategory> Categories { get; set; } |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Validate the object. |
| | 56 | | /// </summary> |
| | 57 | | /// <exception cref="ValidationException"> |
| | 58 | | /// Thrown if validation fails |
| | 59 | | /// </exception> |
| | 60 | | public virtual void Validate() |
| | 61 | | { |
| 0 | 62 | | if (BannerTiles == null) |
| | 63 | | { |
| 0 | 64 | | throw new ValidationException(ValidationRules.CannotBeNull, "BannerTiles"); |
| | 65 | | } |
| 0 | 66 | | if (Categories == null) |
| | 67 | | { |
| 0 | 68 | | throw new ValidationException(ValidationRules.CannotBeNull, "Categories"); |
| | 69 | | } |
| 0 | 70 | | if (BannerTiles != null) |
| | 71 | | { |
| 0 | 72 | | foreach (var element in BannerTiles) |
| | 73 | | { |
| 0 | 74 | | if (element != null) |
| | 75 | | { |
| 0 | 76 | | element.Validate(); |
| | 77 | | } |
| | 78 | | } |
| | 79 | | } |
| 0 | 80 | | if (Categories != null) |
| | 81 | | { |
| 0 | 82 | | foreach (var element1 in Categories) |
| | 83 | | { |
| 0 | 84 | | if (element1 != null) |
| | 85 | | { |
| 0 | 86 | | element1.Validate(); |
| | 87 | | } |
| | 88 | | } |
| | 89 | | } |
| 0 | 90 | | } |
| | 91 | | } |
| | 92 | | } |