| | | 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 news answer. |
| | | 17 | | /// </summary> |
| | | 18 | | public partial class News : SearchResultsAnswer |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the News class. |
| | | 22 | | /// </summary> |
| | 2 | 23 | | public News() |
| | | 24 | | { |
| | | 25 | | CustomInit(); |
| | 2 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Initializes a new instance of the News class. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="value">An array of NewsArticle objects that contain |
| | | 32 | | /// information about news articles that are relevant to the query. If |
| | | 33 | | /// there are no results to return for the request, the array is |
| | | 34 | | /// empty.</param> |
| | | 35 | | /// <param name="id">A String identifier.</param> |
| | | 36 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | | 37 | | /// item.</param> |
| | | 38 | | /// <param name="totalEstimatedMatches">The estimated number of |
| | | 39 | | /// webpages that are relevant to the query. Use this number along with |
| | | 40 | | /// the count and offset query parameters to page the results.</param> |
| | | 41 | | public News(IList<NewsArticle> value, string id = default(string), string webSearchUrl = default(string), IList< |
| | 0 | 42 | | : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly) |
| | | 43 | | { |
| | 0 | 44 | | Value = value; |
| | 0 | 45 | | Location = location; |
| | | 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 an array of NewsArticle objects that contain |
| | | 56 | | /// information about news articles that are relevant to the query. If |
| | | 57 | | /// there are no results to return for the request, the array is empty. |
| | | 58 | | /// </summary> |
| | | 59 | | [JsonProperty(PropertyName = "value")] |
| | 0 | 60 | | public IList<NewsArticle> Value { get; set; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "location")] |
| | 0 | 65 | | public string Location { get; private set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Validate the object. |
| | | 69 | | /// </summary> |
| | | 70 | | /// <exception cref="ValidationException"> |
| | | 71 | | /// Thrown if validation fails |
| | | 72 | | /// </exception> |
| | | 73 | | public override void Validate() |
| | | 74 | | { |
| | 0 | 75 | | base.Validate(); |
| | 0 | 76 | | if (Value == null) |
| | | 77 | | { |
| | 0 | 78 | | throw new ValidationException(ValidationRules.CannotBeNull, "Value"); |
| | | 79 | | } |
| | 0 | 80 | | } |
| | | 81 | | } |
| | | 82 | | } |