Skip to content

Commit 2b99025

Browse files
authored
[FormRecognizer] Make FieldValue's integer value an Int64 (Azure#12320)
1 parent 447e024 commit 2b99025

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- `RecognizeContentOperation` now returns a `FormPageCollection`.
2424
- `RecognizeReceiptsOperation` now returns a `RecognizedReceiptCollection`.
2525
- `RecognizeCustomFormsOperation` now returns a `RecognizedFormCollection`.
26+
- In preparation for service-side changes, `FieldValue.AsInt32` has been replaced by `FieldValue.AsInt64`, which returns a `long`.
2627

2728
### New Features
2829

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public string AsString()
4343
}
4444

4545
/// <summary>
46-
/// Gets the value of the field as an <see cref="int"/>.
46+
/// Gets the value of the field as a <see cref="long"/>.
4747
/// </summary>
48-
/// <returns>The value of the field converted to an <see cref="int"/>.</returns>
48+
/// <returns>The value of the field converted to a <see cref="long"/>.</returns>
4949
/// <exception cref="InvalidOperationException">Thrown when <see cref="Type"/> is not <see cref="FieldValueType.Integer"/> or when the value is <c>null</c>.</exception>
50-
public int AsInt32()
50+
public long AsInt64()
5151
{
5252
if (Type != FieldValueType.Integer)
5353
{

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ namespace Azure.AI.FormRecognizer.Models
88
[CodeGenModel("FieldValue")]
99
internal partial class FieldValue_internal
1010
{
11+
/// <summary>Integer value.</summary>
12+
public long? ValueInteger { get; }
13+
1114
internal FieldValue_internal(string value)
1215
{
1316
Type = FieldValueType.String;

sdk/formrecognizer/Azure.AI.FormRecognizer/src/Generated/Models/FieldValue_internal.Serialization.cs

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

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

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ internal static FormField<string> ConvertPhoneNumberField(string fieldName, IRea
5858
return null;
5959
}
6060

61-
internal static FormField<int> ConvertIntField(string fieldName, IReadOnlyDictionary<string, FormField> fields)
61+
internal static FormField<long> ConvertInt64Field(string fieldName, IReadOnlyDictionary<string, FormField> fields)
6262
{
6363
FormField field;
6464
if (fields.TryGetValue(fieldName, out field))
6565
{
66-
return new FormField<int>(field, field.Value.AsInt32());
66+
return new FormField<long>(field, field.Value.AsInt64());
6767
}
6868

6969
return null;

0 commit comments

Comments
 (0)