| | 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 text region |
| | 21 | | /// </summary> |
| | 22 | | public partial class TextRecognitionResult |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Initializes a new instance of the TextRecognitionResult class. |
| | 26 | | /// </summary> |
| 0 | 27 | | public TextRecognitionResult() |
| | 28 | | { |
| | 29 | | CustomInit(); |
| 0 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Initializes a new instance of the TextRecognitionResult class. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="lines">A list of recognized text lines.</param> |
| | 36 | | /// <param name="page">The 1-based page number of the recognition |
| | 37 | | /// result.</param> |
| | 38 | | /// <param name="clockwiseOrientation">The orientation of the image in |
| | 39 | | /// degrees in the clockwise direction. Range between [0, 360).</param> |
| | 40 | | /// <param name="width">The width of the image in pixels or the PDF in |
| | 41 | | /// inches.</param> |
| | 42 | | /// <param name="height">The height of the image in pixels or the PDF |
| | 43 | | /// in inches.</param> |
| | 44 | | /// <param name="unit">The unit used in the Width, Height and |
| | 45 | | /// BoundingBox. For images, the unit is 'pixel'. For PDF, the unit is |
| | 46 | | /// 'inch'. Possible values include: 'pixel', 'inch'</param> |
| 0 | 47 | | public TextRecognitionResult(IList<Line> lines, int? page = default(int?), double? clockwiseOrientation = defaul |
| | 48 | | { |
| 0 | 49 | | Page = page; |
| 0 | 50 | | ClockwiseOrientation = clockwiseOrientation; |
| 0 | 51 | | Width = width; |
| 0 | 52 | | Height = height; |
| 0 | 53 | | Unit = unit; |
| 0 | 54 | | Lines = lines; |
| | 55 | | CustomInit(); |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// An initialization method that performs custom operations like setting defaults |
| | 60 | | /// </summary> |
| | 61 | | partial void CustomInit(); |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Gets or sets the 1-based page number of the recognition result. |
| | 65 | | /// </summary> |
| | 66 | | [JsonProperty(PropertyName = "page")] |
| 0 | 67 | | public int? Page { get; set; } |
| | 68 | |
|
| | 69 | | /// <summary> |
| | 70 | | /// Gets or sets the orientation of the image in degrees in the |
| | 71 | | /// clockwise direction. Range between [0, 360). |
| | 72 | | /// </summary> |
| | 73 | | [JsonProperty(PropertyName = "clockwiseOrientation")] |
| 0 | 74 | | public double? ClockwiseOrientation { get; set; } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets or sets the width of the image in pixels or the PDF in inches. |
| | 78 | | /// </summary> |
| | 79 | | [JsonProperty(PropertyName = "width")] |
| 0 | 80 | | public double? Width { get; set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Gets or sets the height of the image in pixels or the PDF in |
| | 84 | | /// inches. |
| | 85 | | /// </summary> |
| | 86 | | [JsonProperty(PropertyName = "height")] |
| 0 | 87 | | public double? Height { get; set; } |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// Gets or sets the unit used in the Width, Height and BoundingBox. |
| | 91 | | /// For images, the unit is 'pixel'. For PDF, the unit is 'inch'. |
| | 92 | | /// Possible values include: 'pixel', 'inch' |
| | 93 | | /// </summary> |
| | 94 | | [JsonProperty(PropertyName = "unit")] |
| 0 | 95 | | public TextRecognitionResultDimensionUnit? Unit { get; set; } |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Gets or sets a list of recognized text lines. |
| | 99 | | /// </summary> |
| | 100 | | [JsonProperty(PropertyName = "lines")] |
| 0 | 101 | | public IList<Line> Lines { get; set; } |
| | 102 | |
|
| | 103 | | /// <summary> |
| | 104 | | /// Validate the object. |
| | 105 | | /// </summary> |
| | 106 | | /// <exception cref="ValidationException"> |
| | 107 | | /// Thrown if validation fails |
| | 108 | | /// </exception> |
| | 109 | | public virtual void Validate() |
| | 110 | | { |
| 0 | 111 | | if (Lines == null) |
| | 112 | | { |
| 0 | 113 | | throw new ValidationException(ValidationRules.CannotBeNull, "Lines"); |
| | 114 | | } |
| 0 | 115 | | } |
| | 116 | | } |
| | 117 | | } |