| | 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 | | [Newtonsoft.Json.JsonObject("SpellCheck")] |
| | 16 | | public partial class SpellCheckModel : Answer |
| | 17 | | { |
| | 18 | | /// <summary> |
| | 19 | | /// Initializes a new instance of the SpellCheckModel class. |
| | 20 | | /// </summary> |
| 1 | 21 | | public SpellCheckModel() |
| | 22 | | { |
| | 23 | | CustomInit(); |
| 1 | 24 | | } |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the SpellCheckModel class. |
| | 28 | | /// </summary> |
| | 29 | | /// <param name="id">A String identifier.</param> |
| | 30 | | public SpellCheckModel(IList<SpellingFlaggedToken> flaggedTokens, string id = default(string)) |
| 0 | 31 | | : base(id) |
| | 32 | | { |
| 0 | 33 | | FlaggedTokens = flaggedTokens; |
| | 34 | | CustomInit(); |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// An initialization method that performs custom operations like setting defaults |
| | 39 | | /// </summary> |
| | 40 | | partial void CustomInit(); |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// </summary> |
| | 44 | | [JsonProperty(PropertyName = "flaggedTokens")] |
| 4 | 45 | | public IList<SpellingFlaggedToken> FlaggedTokens { get; set; } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Validate the object. |
| | 49 | | /// </summary> |
| | 50 | | /// <exception cref="ValidationException"> |
| | 51 | | /// Thrown if validation fails |
| | 52 | | /// </exception> |
| | 53 | | public virtual void Validate() |
| | 54 | | { |
| 0 | 55 | | if (FlaggedTokens == null) |
| | 56 | | { |
| 0 | 57 | | throw new ValidationException(ValidationRules.CannotBeNull, "FlaggedTokens"); |
| | 58 | | } |
| 0 | 59 | | if (FlaggedTokens != null) |
| | 60 | | { |
| 0 | 61 | | foreach (var element in FlaggedTokens) |
| | 62 | | { |
| 0 | 63 | | if (element != null) |
| | 64 | | { |
| 0 | 65 | | element.Validate(); |
| | 66 | | } |
| | 67 | | } |
| | 68 | | } |
| 0 | 69 | | } |
| | 70 | | } |
| | 71 | | } |