| | 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 TrendingVideosSubcategory |
| | 16 | | { |
| | 17 | | /// <summary> |
| | 18 | | /// Initializes a new instance of the TrendingVideosSubcategory class. |
| | 19 | | /// </summary> |
| 24 | 20 | | public TrendingVideosSubcategory() |
| | 21 | | { |
| | 22 | | CustomInit(); |
| 24 | 23 | | } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Initializes a new instance of the TrendingVideosSubcategory class. |
| | 27 | | /// </summary> |
| 0 | 28 | | public TrendingVideosSubcategory(string title, IList<TrendingVideosTile> tiles) |
| | 29 | | { |
| 0 | 30 | | Title = title; |
| 0 | 31 | | Tiles = tiles; |
| | 32 | | CustomInit(); |
| 0 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// An initialization method that performs custom operations like setting defaults |
| | 37 | | /// </summary> |
| | 38 | | partial void CustomInit(); |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// </summary> |
| | 42 | | [JsonProperty(PropertyName = "title")] |
| 26 | 43 | | public string Title { get; set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// </summary> |
| | 47 | | [JsonProperty(PropertyName = "tiles")] |
| 54 | 48 | | public IList<TrendingVideosTile> Tiles { get; set; } |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Validate the object. |
| | 52 | | /// </summary> |
| | 53 | | /// <exception cref="ValidationException"> |
| | 54 | | /// Thrown if validation fails |
| | 55 | | /// </exception> |
| | 56 | | public virtual void Validate() |
| | 57 | | { |
| 0 | 58 | | if (Title == null) |
| | 59 | | { |
| 0 | 60 | | throw new ValidationException(ValidationRules.CannotBeNull, "Title"); |
| | 61 | | } |
| 0 | 62 | | if (Tiles == null) |
| | 63 | | { |
| 0 | 64 | | throw new ValidationException(ValidationRules.CannotBeNull, "Tiles"); |
| | 65 | | } |
| 0 | 66 | | if (Tiles != null) |
| | 67 | | { |
| 0 | 68 | | foreach (var element in Tiles) |
| | 69 | | { |
| 0 | 70 | | if (element != null) |
| | 71 | | { |
| 0 | 72 | | element.Validate(); |
| | 73 | | } |
| | 74 | | } |
| | 75 | | } |
| 0 | 76 | | } |
| | 77 | | } |
| | 78 | | } |