| | 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.WebSearch.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 | | public Videos(IList<VideoObject> value, string id = default(string), string webSearchUrl = default(string), ILis |
| 0 | 40 | | : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly) |
| | 41 | | { |
| 0 | 42 | | Value = value; |
| 0 | 43 | | NextOffset = nextOffset; |
| 0 | 44 | | QueryExpansions = queryExpansions; |
| 0 | 45 | | RelatedSearches = relatedSearches; |
| | 46 | | CustomInit(); |
| 0 | 47 | | } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// An initialization method that performs custom operations like setting defaults |
| | 51 | | /// </summary> |
| | 52 | | partial void CustomInit(); |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Gets or sets a list of video objects that are relevant to the |
| | 56 | | /// query. |
| | 57 | | /// </summary> |
| | 58 | | [JsonProperty(PropertyName = "value")] |
| 0 | 59 | | public IList<VideoObject> Value { get; set; } |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// </summary> |
| | 63 | | [JsonProperty(PropertyName = "nextOffset")] |
| 0 | 64 | | public int? NextOffset { get; private set; } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// </summary> |
| | 68 | | [JsonProperty(PropertyName = "queryExpansions")] |
| 0 | 69 | | public IList<Query> QueryExpansions { get; private set; } |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// </summary> |
| | 73 | | [JsonProperty(PropertyName = "relatedSearches")] |
| 0 | 74 | | public IList<Query> RelatedSearches { get; private set; } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Validate the object. |
| | 78 | | /// </summary> |
| | 79 | | /// <exception cref="ValidationException"> |
| | 80 | | /// Thrown if validation fails |
| | 81 | | /// </exception> |
| | 82 | | public override void Validate() |
| | 83 | | { |
| 0 | 84 | | base.Validate(); |
| 0 | 85 | | if (Value == null) |
| | 86 | | { |
| 0 | 87 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | 88 | | } |
| 0 | 89 | | if (QueryExpansions != null) |
| | 90 | | { |
| 0 | 91 | | foreach (var element in QueryExpansions) |
| | 92 | | { |
| 0 | 93 | | if (element != null) |
| | 94 | | { |
| 0 | 95 | | element.Validate(); |
| | 96 | | } |
| | 97 | | } |
| | 98 | | } |
| 0 | 99 | | if (RelatedSearches != null) |
| | 100 | | { |
| 0 | 101 | | foreach (var element1 in RelatedSearches) |
| | 102 | | { |
| 0 | 103 | | if (element1 != null) |
| | 104 | | { |
| 0 | 105 | | element1.Validate(); |
| | 106 | | } |
| | 107 | | } |
| | 108 | | } |
| 0 | 109 | | } |
| | 110 | | } |
| | 111 | | } |