Skip to content

Commit 4b96b18

Browse files
authored
Set default values for table cell properties (Azure#27317)
1 parent f74a1c9 commit 4b96b18

File tree

5 files changed

+40
-19
lines changed

5 files changed

+40
-19
lines changed

sdk/formrecognizer/Azure.AI.FormRecognizer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
### Breaking Changes
99
- Made `DocumentSpan` a `struct` instead of a `class`.
10+
- In `DocumentTableCell`, properties `Kind`, `RowSpan`, and `ColumnSpan` are not nullable anymore.
1011

1112
### Bugs Fixed
1213

sdk/formrecognizer/Azure.AI.FormRecognizer/api/Azure.AI.FormRecognizer.netstandard2.0.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public static partial class DocumentAnalysisModelFactory
445445
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan DocumentSpan(int offset = 0, int length = 0) { throw null; }
446446
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentStyle DocumentStyle(bool? isHandwritten = default(bool?), System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan> spans = null, float confidence = 0f) { throw null; }
447447
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTable DocumentTable(int rowCount = 0, int columnCount = 0, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCell> cells = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.BoundingRegion> boundingRegions = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan> spans = null) { throw null; }
448-
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCell DocumentTableCell(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind? kind = default(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind?), int rowIndex = 0, int columnIndex = 0, int? rowSpan = default(int?), int? columnSpan = default(int?), string content = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.BoundingRegion> boundingRegions = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan> spans = null) { throw null; }
448+
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCell DocumentTableCell(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind kind = default(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind), int rowIndex = 0, int columnIndex = 0, int rowSpan = 0, int columnSpan = 0, string content = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.BoundingRegion> boundingRegions = null, System.Collections.Generic.IEnumerable<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan> spans = null) { throw null; }
449449
public static Azure.AI.FormRecognizer.DocumentAnalysis.DocumentWord DocumentWord(string content = null, Azure.AI.FormRecognizer.DocumentAnalysis.BoundingBox boundingBox = default(Azure.AI.FormRecognizer.DocumentAnalysis.BoundingBox), Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan span = default(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan), float confidence = 0f) { throw null; }
450450
public static Azure.AI.FormRecognizer.DocumentAnalysis.ModelOperation ModelOperation(string operationId = null, Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationStatus status = Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationStatus.NotStarted, int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationKind kind = default(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationKind), string resourceLocation = null, System.Collections.Generic.IReadOnlyDictionary<string, string> tags = null, Azure.ResponseError error = null, Azure.AI.FormRecognizer.DocumentAnalysis.DocumentModel result = null) { throw null; }
451451
public static Azure.AI.FormRecognizer.DocumentAnalysis.ModelOperationInfo ModelOperationInfo(string operationId = null, Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationStatus status = Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationStatus.NotStarted, int? percentCompleted = default(int?), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationKind kind = default(Azure.AI.FormRecognizer.DocumentAnalysis.DocumentOperationKind), string resourceLocation = null, System.Collections.Generic.IReadOnlyDictionary<string, string> tags = null) { throw null; }
@@ -686,11 +686,11 @@ public partial class DocumentTableCell
686686
internal DocumentTableCell() { }
687687
public System.Collections.Generic.IReadOnlyList<Azure.AI.FormRecognizer.DocumentAnalysis.BoundingRegion> BoundingRegions { get { throw null; } }
688688
public int ColumnIndex { get { throw null; } }
689-
public int? ColumnSpan { get { throw null; } }
689+
public int ColumnSpan { get { throw null; } }
690690
public string Content { get { throw null; } }
691-
public Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind? Kind { get { throw null; } }
691+
public Azure.AI.FormRecognizer.DocumentAnalysis.DocumentTableCellKind Kind { get { throw null; } }
692692
public int RowIndex { get { throw null; } }
693-
public int? RowSpan { get { throw null; } }
693+
public int RowSpan { get { throw null; } }
694694
public System.Collections.Generic.IReadOnlyList<Azure.AI.FormRecognizer.DocumentAnalysis.DocumentSpan> Spans { get { throw null; } }
695695
}
696696
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]

sdk/formrecognizer/Azure.AI.FormRecognizer/src/DocumentAnalysisModelFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public static DocumentTable DocumentTable(int rowCount = default, int columnCoun
512512
/// <param name="boundingRegions"> Bounding regions covering the table cell. </param>
513513
/// <param name="spans"> Location of the table cell in the reading order concatenated content. </param>
514514
/// <returns> A new <see cref="DocumentAnalysis.DocumentTableCell"/> instance for mocking. </returns>
515-
public static DocumentTableCell DocumentTableCell(DocumentTableCellKind? kind = null, int rowIndex = default, int columnIndex = default, int? rowSpan = null, int? columnSpan = null, string content = null, IEnumerable<BoundingRegion> boundingRegions = null, IEnumerable<DocumentSpan> spans = null)
515+
public static DocumentTableCell DocumentTableCell(DocumentTableCellKind kind = default, int rowIndex = default, int columnIndex = default, int rowSpan = default, int columnSpan = default, string content = null, IEnumerable<BoundingRegion> boundingRegions = null, IEnumerable<DocumentSpan> spans = null)
516516
{
517517
boundingRegions ??= new List<BoundingRegion>();
518518
spans ??= new List<DocumentSpan>();

sdk/formrecognizer/Azure.AI.FormRecognizer/src/DocumentTableCell.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,32 @@ namespace Azure.AI.FormRecognizer.DocumentAnalysis
88
[CodeGenModel("DocumentTableCell")]
99
public partial class DocumentTableCell
1010
{
11+
private const int DefaultSpanValue = 1;
12+
13+
private static readonly DocumentTableCellKind DefaultTableCellKind = DocumentTableCellKind.Content;
14+
15+
/// <summary>
16+
/// Table cell kind.
17+
/// </summary>
18+
public DocumentTableCellKind Kind => KindPrivate ?? DefaultTableCellKind;
19+
20+
/// <summary>
21+
/// Number of rows spanned by this cell.
22+
/// </summary>
23+
public int RowSpan => RowSpanPrivate ?? DefaultSpanValue;
24+
25+
/// <summary>
26+
/// Number of columns spanned by this cell.
27+
/// </summary>
28+
public int ColumnSpan => ColumnSpanPrivate ?? DefaultSpanValue;
29+
30+
[CodeGenMember("Kind")]
31+
private DocumentTableCellKind? KindPrivate { get; }
32+
33+
[CodeGenMember("RowSpan")]
34+
private int? RowSpanPrivate { get; }
35+
36+
[CodeGenMember("ColumnSpan")]
37+
private int? ColumnSpanPrivate { get; }
1138
}
1239
}

sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/DocumentTableCell.cs

Lines changed: 7 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)