| | | 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.Language.SpellCheck.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 | | public partial class SpellingFlaggedToken |
| | | 16 | | { |
| | | 17 | | /// <summary> |
| | | 18 | | /// Initializes a new instance of the SpellingFlaggedToken class. |
| | | 19 | | /// </summary> |
| | 1 | 20 | | public SpellingFlaggedToken() |
| | | 21 | | { |
| | | 22 | | CustomInit(); |
| | 1 | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Initializes a new instance of the SpellingFlaggedToken class. |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name="type">Possible values include: 'UnknownToken', |
| | | 29 | | /// 'RepeatedToken'</param> |
| | 0 | 30 | | public SpellingFlaggedToken(int offset, string token, string type, IList<SpellingTokenSuggestion> suggestions = |
| | | 31 | | { |
| | 0 | 32 | | Offset = offset; |
| | 0 | 33 | | Token = token; |
| | 0 | 34 | | Type = type; |
| | 0 | 35 | | Suggestions = suggestions; |
| | 0 | 36 | | PingUrlSuffix = pingUrlSuffix; |
| | | 37 | | CustomInit(); |
| | 0 | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// An initialization method that performs custom operations like setting defaults |
| | | 42 | | /// </summary> |
| | | 43 | | partial void CustomInit(); |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// </summary> |
| | | 47 | | [JsonProperty(PropertyName = "offset")] |
| | 0 | 48 | | public int Offset { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// </summary> |
| | | 52 | | [JsonProperty(PropertyName = "token")] |
| | 3 | 53 | | public string Token { get; set; } |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// Gets or sets possible values include: 'UnknownToken', |
| | | 57 | | /// 'RepeatedToken' |
| | | 58 | | /// </summary> |
| | | 59 | | [JsonProperty(PropertyName = "type")] |
| | 2 | 60 | | public string Type { get; set; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// </summary> |
| | | 64 | | [JsonProperty(PropertyName = "suggestions")] |
| | 4 | 65 | | public IList<SpellingTokenSuggestion> Suggestions { get; private set; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// </summary> |
| | | 69 | | [JsonProperty(PropertyName = "pingUrlSuffix")] |
| | 0 | 70 | | public string PingUrlSuffix { get; private set; } |
| | | 71 | | |
| | | 72 | | /// <summary> |
| | | 73 | | /// Validate the object. |
| | | 74 | | /// </summary> |
| | | 75 | | /// <exception cref="ValidationException"> |
| | | 76 | | /// Thrown if validation fails |
| | | 77 | | /// </exception> |
| | | 78 | | public virtual void Validate() |
| | | 79 | | { |
| | 0 | 80 | | if (Token == null) |
| | | 81 | | { |
| | 0 | 82 | | throw new ValidationException(ValidationRules.CannotBeNull, "Token"); |
| | | 83 | | } |
| | 0 | 84 | | if (Type == null) |
| | | 85 | | { |
| | 0 | 86 | | throw new ValidationException(ValidationRules.CannotBeNull, "Type"); |
| | | 87 | | } |
| | 0 | 88 | | if (Suggestions != null) |
| | | 89 | | { |
| | 0 | 90 | | foreach (var element in Suggestions) |
| | | 91 | | { |
| | 0 | 92 | | if (element != null) |
| | | 93 | | { |
| | 0 | 94 | | element.Validate(); |
| | | 95 | | } |
| | | 96 | | } |
| | | 97 | | } |
| | 0 | 98 | | } |
| | | 99 | | } |
| | | 100 | | } |