|  |  | 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.Linq; | 
|  |  | 12 |  |  | 
|  |  | 13 |  |     /// <summary> | 
|  |  | 14 |  |     /// Defines a search result item to display | 
|  |  | 15 |  |     /// </summary> | 
|  |  | 16 |  |     public partial class RankingRankingItem | 
|  |  | 17 |  |     { | 
|  |  | 18 |  |         /// <summary> | 
|  |  | 19 |  |         /// Initializes a new instance of the RankingRankingItem class. | 
|  |  | 20 |  |         /// </summary> | 
|  | 20 | 21 |  |         public RankingRankingItem() | 
|  |  | 22 |  |         { | 
|  |  | 23 |  |             CustomInit(); | 
|  | 20 | 24 |  |         } | 
|  |  | 25 |  |  | 
|  |  | 26 |  |         /// <summary> | 
|  |  | 27 |  |         /// Initializes a new instance of the RankingRankingItem class. | 
|  |  | 28 |  |         /// </summary> | 
|  |  | 29 |  |         /// <param name="answerType">The answer that contains the item to | 
|  |  | 30 |  |         /// display. Use the type to find the answer in the SearchResponse | 
|  |  | 31 |  |         /// object. The type is the name of a SearchResponse field. Possible | 
|  |  | 32 |  |         /// values include: 'WebPages', 'Images', 'SpellSuggestions', 'News', | 
|  |  | 33 |  |         /// 'RelatedSearches', 'Videos', 'Computation', 'TimeZone'</param> | 
|  |  | 34 |  |         /// <param name="resultIndex">A zero-based index of the item in the | 
|  |  | 35 |  |         /// answer.If the item does not include this field, display all items | 
|  |  | 36 |  |         /// in the answer. For example, display all news articles in the News | 
|  |  | 37 |  |         /// answer.</param> | 
|  |  | 38 |  |         /// <param name="value">The ID that identifies either an answer to | 
|  |  | 39 |  |         /// display or an item of an answer to display. If the ID identifies an | 
|  |  | 40 |  |         /// answer, display all items of the answer.</param> | 
|  | 0 | 41 |  |         public RankingRankingItem(string answerType, int? resultIndex = default(int?), Identifiable value = default(Iden | 
|  |  | 42 |  |         { | 
|  | 0 | 43 |  |             AnswerType = answerType; | 
|  | 0 | 44 |  |             ResultIndex = resultIndex; | 
|  | 0 | 45 |  |             Value = value; | 
|  | 0 | 46 |  |             HtmlIndex = htmlIndex; | 
|  | 0 | 47 |  |             TextualIndex = textualIndex; | 
|  | 0 | 48 |  |             ScreenshotIndex = screenshotIndex; | 
|  |  | 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 the answer that contains the item to display. Use the | 
|  |  | 59 |  |         /// type to find the answer in the SearchResponse object. The type is | 
|  |  | 60 |  |         /// the name of a SearchResponse field. Possible values include: | 
|  |  | 61 |  |         /// 'WebPages', 'Images', 'SpellSuggestions', 'News', | 
|  |  | 62 |  |         /// 'RelatedSearches', 'Videos', 'Computation', 'TimeZone' | 
|  |  | 63 |  |         /// </summary> | 
|  |  | 64 |  |         [JsonProperty(PropertyName = "answerType")] | 
|  | 0 | 65 |  |         public string AnswerType { get; set; } | 
|  |  | 66 |  |  | 
|  |  | 67 |  |         /// <summary> | 
|  |  | 68 |  |         /// Gets a zero-based index of the item in the answer.If the item does | 
|  |  | 69 |  |         /// not include this field, display all items in the answer. For | 
|  |  | 70 |  |         /// example, display all news articles in the News answer. | 
|  |  | 71 |  |         /// </summary> | 
|  |  | 72 |  |         [JsonProperty(PropertyName = "resultIndex")] | 
|  | 0 | 73 |  |         public int? ResultIndex { get; private set; } | 
|  |  | 74 |  |  | 
|  |  | 75 |  |         /// <summary> | 
|  |  | 76 |  |         /// Gets the ID that identifies either an answer to display or an item | 
|  |  | 77 |  |         /// of an answer to display. If the ID identifies an answer, display | 
|  |  | 78 |  |         /// all items of the answer. | 
|  |  | 79 |  |         /// </summary> | 
|  |  | 80 |  |         [JsonProperty(PropertyName = "value")] | 
|  | 36 | 81 |  |         public Identifiable Value { get; private set; } | 
|  |  | 82 |  |  | 
|  |  | 83 |  |         /// <summary> | 
|  |  | 84 |  |         /// </summary> | 
|  |  | 85 |  |         [JsonProperty(PropertyName = "htmlIndex")] | 
|  | 0 | 86 |  |         public int? HtmlIndex { get; private set; } | 
|  |  | 87 |  |  | 
|  |  | 88 |  |         /// <summary> | 
|  |  | 89 |  |         /// </summary> | 
|  |  | 90 |  |         [JsonProperty(PropertyName = "textualIndex")] | 
|  | 0 | 91 |  |         public int? TextualIndex { get; private set; } | 
|  |  | 92 |  |  | 
|  |  | 93 |  |         /// <summary> | 
|  |  | 94 |  |         /// </summary> | 
|  |  | 95 |  |         [JsonProperty(PropertyName = "screenshotIndex")] | 
|  | 0 | 96 |  |         public int? ScreenshotIndex { get; private set; } | 
|  |  | 97 |  |  | 
|  |  | 98 |  |         /// <summary> | 
|  |  | 99 |  |         /// Validate the object. | 
|  |  | 100 |  |         /// </summary> | 
|  |  | 101 |  |         /// <exception cref="ValidationException"> | 
|  |  | 102 |  |         /// Thrown if validation fails | 
|  |  | 103 |  |         /// </exception> | 
|  |  | 104 |  |         public virtual void Validate() | 
|  |  | 105 |  |         { | 
|  | 0 | 106 |  |             if (AnswerType == null) | 
|  |  | 107 |  |             { | 
|  | 0 | 108 |  |                 throw new ValidationException(ValidationRules.CannotBeNull, "AnswerType"); | 
|  |  | 109 |  |             } | 
|  | 0 | 110 |  |         } | 
|  |  | 111 |  |     } | 
|  |  | 112 |  | } |