| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.CognitiveServices.FormRecognizer.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Linq; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// An object representing a recognized word. |
| | 21 | | /// </summary> |
| | 22 | | public partial class Word |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the Word class. |
| | 26 | | /// </summary> |
| 0 | 27 | | public Word() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 0 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the Word class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="boundingBox">Bounding box of a recognized |
| | 36 | | /// word.</param> |
| | 37 | | /// <param name="text">The text content of the word.</param> |
| | 38 | | /// <param name="confidence">Qualitative confidence measure. Possible |
| | 39 | | /// values include: 'High', 'Low'</param> |
| 0 | 40 | | public Word(IList<int> boundingBox, string text, TextRecognitionResultConfidenceClass? confidence = default(Text |
| | 41 | | { |
| 0 | 42 | | BoundingBox = boundingBox; |
| 0 | 43 | | Text = text; |
| 0 | 44 | | Confidence = confidence; |
| | 45 | | CustomInit(); |
| 0 | 46 | | } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// An initialization method that performs custom operations like setting defaults |
| | 50 | | /// </summary> |
| | 51 | | partial void CustomInit(); |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Gets or sets bounding box of a recognized word. |
| | 55 | | /// </summary> |
| | 56 | | [JsonProperty(PropertyName = "boundingBox")] |
| 0 | 57 | | public IList<int> BoundingBox { get; set; } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets or sets the text content of the word. |
| | 61 | | /// </summary> |
| | 62 | | [JsonProperty(PropertyName = "text")] |
| 0 | 63 | | public string Text { get; set; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Gets or sets qualitative confidence measure. Possible values |
| | 67 | | /// include: 'High', 'Low' |
| | 68 | | /// </summary> |
| | 69 | | [JsonProperty(PropertyName = "confidence")] |
| 0 | 70 | | public TextRecognitionResultConfidenceClass? Confidence { get; 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 (BoundingBox == null) |
| | 81 | | { |
| 0 | 82 | | throw new ValidationException(ValidationRules.CannotBeNull, "BoundingBox"); |
| | 83 | | } |
| 0 | 84 | | if (Text == null) |
| | 85 | | { |
| 0 | 86 | | throw new ValidationException(ValidationRules.CannotBeNull, "Text"); |
| | 87 | | } |
| 0 | 88 | | } |
| | 89 | | } |
| | 90 | | } |