| | | 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.NewsSearch.Models |
| | | 8 | | { |
| | | 9 | | using Newtonsoft.Json; |
| | | 10 | | using System.Linq; |
| | | 11 | | |
| | | 12 | | [Newtonsoft.Json.JsonObject("News/Topic")] |
| | | 13 | | public partial class NewsTopic : Thing |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Initializes a new instance of the NewsTopic class. |
| | | 17 | | /// </summary> |
| | 10 | 18 | | public NewsTopic() |
| | | 19 | | { |
| | | 20 | | CustomInit(); |
| | 10 | 21 | | } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Initializes a new instance of the NewsTopic class. |
| | | 25 | | /// </summary> |
| | | 26 | | /// <param name="id">A String identifier.</param> |
| | | 27 | | /// <param name="webSearchUrl">The URL To Bing's search result for this |
| | | 28 | | /// item.</param> |
| | | 29 | | /// <param name="name">The name of the thing represented by this |
| | | 30 | | /// object.</param> |
| | | 31 | | /// <param name="url">The URL to get more information about the thing |
| | | 32 | | /// represented by this object.</param> |
| | | 33 | | /// <param name="image">An image of the item.</param> |
| | | 34 | | /// <param name="description">A short description of the item.</param> |
| | | 35 | | /// <param name="alternateName">An alias for the item</param> |
| | | 36 | | /// <param name="bingId">An ID that uniquely identifies this |
| | | 37 | | /// item.</param> |
| | | 38 | | /// <param name="isBreakingNews">A Boolean value that indicates whether |
| | | 39 | | /// the topic is considered breaking news. If the topic is considered |
| | | 40 | | /// breaking news, the value is true.</param> |
| | | 41 | | /// <param name="query">A search query term that returns this trending |
| | | 42 | | /// topic.</param> |
| | | 43 | | /// <param name="newsSearchUrl">The URL to the Bing News search results |
| | | 44 | | /// for the search query term</param> |
| | | 45 | | public NewsTopic(string id = default(string), string webSearchUrl = default(string), string name = default(strin |
| | 0 | 46 | | : base(id, webSearchUrl, name, url, image, description, alternateName, bingId) |
| | | 47 | | { |
| | 0 | 48 | | IsBreakingNews = isBreakingNews; |
| | 0 | 49 | | Query = query; |
| | 0 | 50 | | NewsSearchUrl = newsSearchUrl; |
| | | 51 | | CustomInit(); |
| | 0 | 52 | | } |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// An initialization method that performs custom operations like setting defaults |
| | | 56 | | /// </summary> |
| | | 57 | | partial void CustomInit(); |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Gets a Boolean value that indicates whether the topic is considered |
| | | 61 | | /// breaking news. If the topic is considered breaking news, the value |
| | | 62 | | /// is true. |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "isBreakingNews")] |
| | 0 | 65 | | public bool? IsBreakingNews { get; private set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets a search query term that returns this trending topic. |
| | | 69 | | /// </summary> |
| | | 70 | | [JsonProperty(PropertyName = "query")] |
| | 14 | 71 | | public Query Query { get; private set; } |
| | | 72 | | |
| | | 73 | | /// <summary> |
| | | 74 | | /// Gets the URL to the Bing News search results for the search query |
| | | 75 | | /// term |
| | | 76 | | /// </summary> |
| | | 77 | | [JsonProperty(PropertyName = "newsSearchUrl")] |
| | 12 | 78 | | public string NewsSearchUrl { get; private set; } |
| | | 79 | | |
| | | 80 | | /// <summary> |
| | | 81 | | /// Validate the object. |
| | | 82 | | /// </summary> |
| | | 83 | | /// <exception cref="Rest.ValidationException"> |
| | | 84 | | /// Thrown if validation fails |
| | | 85 | | /// </exception> |
| | | 86 | | public virtual void Validate() |
| | | 87 | | { |
| | 0 | 88 | | if (Query != null) |
| | | 89 | | { |
| | 0 | 90 | | Query.Validate(); |
| | | 91 | | } |
| | 0 | 92 | | } |
| | | 93 | | } |
| | | 94 | | } |