| | 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 | | /// <summary> |
| | 16 | | /// Defines a video answer. |
| | 17 | | /// </summary> |
| | 18 | | public partial class Videos : SearchResultsAnswer |
| | 19 | | { |
| | 20 | | /// <summary> |
| | 21 | | /// Initializes a new instance of the Videos class. |
| | 22 | | /// </summary> |
| 2 | 23 | | public Videos() |
| | 24 | | { |
| | 25 | | CustomInit(); |
| 2 | 26 | | } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Initializes a new instance of the Videos class. |
| | 30 | | /// </summary> |
| | 31 | | /// <param name="value">A list of video objects that are relevant to |
| | 32 | | /// the query.</param> |
| | 33 | | /// <param name="id">A String identifier.</param> |
| | 34 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | 35 | | /// item.</param> |
| | 36 | | /// <param name="totalEstimatedMatches">The estimated number of |
| | 37 | | /// webpages that are relevant to the query. Use this number along with |
| | 38 | | /// the count and offset query parameters to page the results.</param> |
| | 39 | | /// <param name="scenario">Possible values include: 'List', |
| | 40 | | /// 'SingleDominantVideo'</param> |
| | 41 | | public Videos(IList<VideoObject> value, string id = default(string), string webSearchUrl = default(string), ILis |
| 0 | 42 | | : base(id, webSearchUrl, followUpQueries, totalEstimatedMatches, isFamilyFriendly) |
| | 43 | | { |
| 0 | 44 | | Value = value; |
| 0 | 45 | | NextOffset = nextOffset; |
| 0 | 46 | | Scenario = scenario; |
| 0 | 47 | | QueryExpansions = queryExpansions; |
| 0 | 48 | | PivotSuggestions = pivotSuggestions; |
| | 49 | | CustomInit(); |
| 0 | 50 | | } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// An initialization method that performs custom operations like setting defaults |
| | 54 | | /// </summary> |
| | 55 | | partial void CustomInit(); |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets or sets a list of video objects that are relevant to the |
| | 59 | | /// query. |
| | 60 | | /// </summary> |
| | 61 | | [JsonProperty(PropertyName = "value")] |
| 8 | 62 | | public IList<VideoObject> Value { get; set; } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// </summary> |
| | 66 | | [JsonProperty(PropertyName = "nextOffset")] |
| 0 | 67 | | public int? NextOffset { get; private set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Gets possible values include: 'List', 'SingleDominantVideo' |
| | 71 | | /// </summary> |
| | 72 | | [JsonProperty(PropertyName = "scenario")] |
| 0 | 73 | | public VideoQueryScenario? Scenario { get; private set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// </summary> |
| | 77 | | [JsonProperty(PropertyName = "queryExpansions")] |
| 0 | 78 | | public IList<Query> QueryExpansions { get; private set; } |
| | 79 | |
|
| | 80 | | /// <summary> |
| | 81 | | /// </summary> |
| | 82 | | [JsonProperty(PropertyName = "pivotSuggestions")] |
| 0 | 83 | | public IList<PivotSuggestions> PivotSuggestions { get; private set; } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Validate the object. |
| | 87 | | /// </summary> |
| | 88 | | /// <exception cref="ValidationException"> |
| | 89 | | /// Thrown if validation fails |
| | 90 | | /// </exception> |
| | 91 | | public virtual void Validate() |
| | 92 | | { |
| 0 | 93 | | if (Value == null) |
| | 94 | | { |
| 0 | 95 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 96 | | } |
| 0 | 97 | | if (QueryExpansions != null) |
| | 98 | | { |
| 0 | 99 | | foreach (var element in QueryExpansions) |
| | 100 | | { |
| 0 | 101 | | if (element != null) |
| | 102 | | { |
| 0 | 103 | | element.Validate(); |
| | 104 | | } |
| | 105 | | } |
| | 106 | | } |
| 0 | 107 | | if (PivotSuggestions != null) |
| | 108 | | { |
| 0 | 109 | | foreach (var element1 in PivotSuggestions) |
| | 110 | | { |
| 0 | 111 | | if (element1 != null) |
| | 112 | | { |
| 0 | 113 | | element1.Validate(); |
| | 114 | | } |
| | 115 | | } |
| | 116 | | } |
| 0 | 117 | | } |
| | 118 | | } |
| | 119 | | } |