|  |  | 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 PivotSuggestions | 
|  |  | 16 |  |     { | 
|  |  | 17 |  |         /// <summary> | 
|  |  | 18 |  |         /// Initializes a new instance of the PivotSuggestions class. | 
|  |  | 19 |  |         /// </summary> | 
|  | 2 | 20 |  |         public PivotSuggestions() | 
|  |  | 21 |  |         { | 
|  |  | 22 |  |             CustomInit(); | 
|  | 2 | 23 |  |         } | 
|  |  | 24 |  |  | 
|  |  | 25 |  |         /// <summary> | 
|  |  | 26 |  |         /// Initializes a new instance of the PivotSuggestions class. | 
|  |  | 27 |  |         /// </summary> | 
|  | 0 | 28 |  |         public PivotSuggestions(string pivot, IList<Query> suggestions) | 
|  |  | 29 |  |         { | 
|  | 0 | 30 |  |             Pivot = pivot; | 
|  | 0 | 31 |  |             Suggestions = suggestions; | 
|  |  | 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 = "pivot")] | 
|  | 0 | 43 |  |         public string Pivot { get; set; } | 
|  |  | 44 |  |  | 
|  |  | 45 |  |         /// <summary> | 
|  |  | 46 |  |         /// </summary> | 
|  |  | 47 |  |         [JsonProperty(PropertyName = "suggestions")] | 
|  | 4 | 48 |  |         public IList<Query> Suggestions { 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 (Pivot == null) | 
|  |  | 59 |  |             { | 
|  | 0 | 60 |  |                 throw new ValidationException(ValidationRules.CannotBeNull, "Pivot"); | 
|  |  | 61 |  |             } | 
|  | 0 | 62 |  |             if (Suggestions == null) | 
|  |  | 63 |  |             { | 
|  | 0 | 64 |  |                 throw new ValidationException(ValidationRules.CannotBeNull, "Suggestions"); | 
|  |  | 65 |  |             } | 
|  | 0 | 66 |  |             if (Suggestions != null) | 
|  |  | 67 |  |             { | 
|  | 0 | 68 |  |                 foreach (var element in Suggestions) | 
|  |  | 69 |  |                 { | 
|  | 0 | 70 |  |                     if (element != null) | 
|  |  | 71 |  |                     { | 
|  | 0 | 72 |  |                         element.Validate(); | 
|  |  | 73 |  |                     } | 
|  |  | 74 |  |                 } | 
|  |  | 75 |  |             } | 
|  | 0 | 76 |  |         } | 
|  |  | 77 |  |     } | 
|  |  | 78 |  | } |