Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit 2d0772e

Browse files
feat: add confidence field to the PageAnchor.PageRef in document.proto (#453)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/413a5335-c746-4ecb-9a63-55fadf617f2b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 370513265 Source-Link: googleapis/googleapis@7713e2e
1 parent ce87c21 commit 2d0772e

File tree

4 files changed

+151
-44
lines changed

4 files changed

+151
-44
lines changed

proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/Document.java

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42829,6 +42829,19 @@ public interface PageRefOrBuilder
4282942829
* </code>
4283042830
*/
4283142831
com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder();
42832+
42833+
/**
42834+
*
42835+
*
42836+
* <pre>
42837+
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
42838+
* </pre>
42839+
*
42840+
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
42841+
*
42842+
* @return The confidence.
42843+
*/
42844+
float getConfidence();
4283242845
}
4283342846
/**
4283442847
*
@@ -42916,6 +42929,11 @@ private PageRef(
4291642929
boundingPoly_ = subBuilder.buildPartial();
4291742930
}
4291842931

42932+
break;
42933+
}
42934+
case 45:
42935+
{
42936+
confidence_ = input.readFloat();
4291942937
break;
4292042938
}
4292142939
default:
@@ -43392,6 +43410,24 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui
4339243410
return getBoundingPoly();
4339343411
}
4339443412

43413+
public static final int CONFIDENCE_FIELD_NUMBER = 5;
43414+
private float confidence_;
43415+
/**
43416+
*
43417+
*
43418+
* <pre>
43419+
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
43420+
* </pre>
43421+
*
43422+
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
43423+
*
43424+
* @return The confidence.
43425+
*/
43426+
@java.lang.Override
43427+
public float getConfidence() {
43428+
return confidence_;
43429+
}
43430+
4339543431
private byte memoizedIsInitialized = -1;
4339643432

4339743433
@java.lang.Override
@@ -43421,6 +43457,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
4342143457
if (boundingPoly_ != null) {
4342243458
output.writeMessage(4, getBoundingPoly());
4342343459
}
43460+
if (confidence_ != 0F) {
43461+
output.writeFloat(5, confidence_);
43462+
}
4342443463
unknownFields.writeTo(output);
4342543464
}
4342643465

@@ -43445,6 +43484,9 @@ public int getSerializedSize() {
4344543484
if (boundingPoly_ != null) {
4344643485
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBoundingPoly());
4344743486
}
43487+
if (confidence_ != 0F) {
43488+
size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_);
43489+
}
4344843490
size += unknownFields.getSerializedSize();
4344943491
memoizedSize = size;
4345043492
return size;
@@ -43468,6 +43510,8 @@ public boolean equals(final java.lang.Object obj) {
4346843510
if (hasBoundingPoly()) {
4346943511
if (!getBoundingPoly().equals(other.getBoundingPoly())) return false;
4347043512
}
43513+
if (java.lang.Float.floatToIntBits(getConfidence())
43514+
!= java.lang.Float.floatToIntBits(other.getConfidence())) return false;
4347143515
if (!unknownFields.equals(other.unknownFields)) return false;
4347243516
return true;
4347343517
}
@@ -43489,6 +43533,8 @@ public int hashCode() {
4348943533
hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER;
4349043534
hash = (53 * hash) + getBoundingPoly().hashCode();
4349143535
}
43536+
hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER;
43537+
hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence());
4349243538
hash = (29 * hash) + unknownFields.hashCode();
4349343539
memoizedHashCode = hash;
4349443540
return hash;
@@ -43649,6 +43695,8 @@ public Builder clear() {
4364943695
boundingPoly_ = null;
4365043696
boundingPolyBuilder_ = null;
4365143697
}
43698+
confidence_ = 0F;
43699+
4365243700
return this;
4365343701
}
4365443702

@@ -43685,6 +43733,7 @@ public com.google.cloud.documentai.v1.Document.PageAnchor.PageRef buildPartial()
4368543733
} else {
4368643734
result.boundingPoly_ = boundingPolyBuilder_.build();
4368743735
}
43736+
result.confidence_ = confidence_;
4368843737
onBuilt();
4368943738
return result;
4369043739
}
@@ -43751,6 +43800,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Document.PageAnchor.Page
4375143800
if (other.hasBoundingPoly()) {
4375243801
mergeBoundingPoly(other.getBoundingPoly());
4375343802
}
43803+
if (other.getConfidence() != 0F) {
43804+
setConfidence(other.getConfidence());
43805+
}
4375443806
this.mergeUnknownFields(other.unknownFields);
4375543807
onChanged();
4375643808
return this;
@@ -44263,6 +44315,58 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui
4426344315
return boundingPolyBuilder_;
4426444316
}
4426544317

44318+
private float confidence_;
44319+
/**
44320+
*
44321+
*
44322+
* <pre>
44323+
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
44324+
* </pre>
44325+
*
44326+
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
44327+
*
44328+
* @return The confidence.
44329+
*/
44330+
@java.lang.Override
44331+
public float getConfidence() {
44332+
return confidence_;
44333+
}
44334+
/**
44335+
*
44336+
*
44337+
* <pre>
44338+
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
44339+
* </pre>
44340+
*
44341+
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
44342+
*
44343+
* @param value The confidence to set.
44344+
* @return This builder for chaining.
44345+
*/
44346+
public Builder setConfidence(float value) {
44347+
44348+
confidence_ = value;
44349+
onChanged();
44350+
return this;
44351+
}
44352+
/**
44353+
*
44354+
*
44355+
* <pre>
44356+
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
44357+
* </pre>
44358+
*
44359+
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
44360+
*
44361+
* @return This builder for chaining.
44362+
*/
44363+
public Builder clearConfidence() {
44364+
44365+
confidence_ = 0F;
44366+
onChanged();
44367+
return this;
44368+
}
44369+
4426644370
@java.lang.Override
4426744371
public final Builder setUnknownFields(
4426844372
final com.google.protobuf.UnknownFieldSet unknownFields) {

proto-google-cloud-document-ai-v1/src/main/java/com/google/cloud/documentai/v1/DocumentProto.java

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
173173
+ "ype/date.proto\032\032google/type/datetime.pro"
174174
+ "to\032\027google/type/money.proto\032 google/type"
175175
+ "/postal_address.proto\032\034google/api/annota"
176-
+ "tions.proto\"\2158\n\010Document\022\022\n\003uri\030\001 \001(\tB\003\340"
176+
+ "tions.proto\"\2468\n\010Document\022\022\n\003uri\030\001 \001(\tB\003\340"
177177
+ "A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A\001H\000\022\021\n\tmime_typ"
178178
+ "e\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A\001\022?\n\013text_style"
179179
+ "s\030\005 \003(\0132*.google.cloud.documentai.v1.Doc"
@@ -320,45 +320,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
320320
+ "ext_segments\030\001 \003(\0132;.google.cloud.docume"
321321
+ "ntai.v1.Document.TextAnchor.TextSegment\022"
322322
+ "\017\n\007content\030\002 \001(\t\0325\n\013TextSegment\022\023\n\013start"
323-
+ "_index\030\001 \001(\003\022\021\n\tend_index\030\002 \001(\003\032\277\003\n\nPage"
323+
+ "_index\030\001 \001(\003\022\021\n\tend_index\030\002 \001(\003\032\330\003\n\nPage"
324324
+ "Anchor\022J\n\tpage_refs\030\001 \003(\01327.google.cloud"
325325
+ ".documentai.v1.Document.PageAnchor.PageR"
326-
+ "ef\032\344\002\n\007PageRef\022\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013lay"
326+
+ "ef\032\375\002\n\007PageRef\022\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013lay"
327327
+ "out_type\030\002 \001(\0162B.google.cloud.documentai"
328328
+ ".v1.Document.PageAnchor.PageRef.LayoutTy"
329329
+ "peB\003\340A\001\022\030\n\tlayout_id\030\003 \001(\tB\005\030\001\340A\001\022D\n\rbou"
330330
+ "nding_poly\030\004 \001(\0132(.google.cloud.document"
331-
+ "ai.v1.BoundingPolyB\003\340A\001\"\207\001\n\nLayoutType\022\033"
332-
+ "\n\027LAYOUT_TYPE_UNSPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r"
333-
+ "\n\tPARAGRAPH\020\002\022\010\n\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VI"
334-
+ "SUAL_ELEMENT\020\005\022\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020"
335-
+ "\007\032\365\002\n\nProvenance\022\020\n\010revision\030\001 \001(\005\022\n\n\002id"
336-
+ "\030\002 \001(\005\022G\n\007parents\030\003 \003(\01326.google.cloud.d"
337-
+ "ocumentai.v1.Document.Provenance.Parent\022"
338-
+ "K\n\004type\030\004 \001(\0162=.google.cloud.documentai."
339-
+ "v1.Document.Provenance.OperationType\032&\n\006"
340-
+ "Parent\022\020\n\010revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\"\212\001\n"
341-
+ "\rOperationType\022\036\n\032OPERATION_TYPE_UNSPECI"
342-
+ "FIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003"
343-
+ "\022\022\n\016EVAL_REQUESTED\020\004\022\021\n\rEVAL_APPROVED\020\005\022"
344-
+ "\020\n\014EVAL_SKIPPED\020\006\032\215\002\n\010Revision\022\017\n\005agent\030"
345-
+ "\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001(\t"
346-
+ "\022\016\n\006parent\030\002 \003(\005\022/\n\013create_time\030\003 \001(\0132\032."
347-
+ "google.protobuf.Timestamp\022O\n\014human_revie"
348-
+ "w\030\006 \001(\01329.google.cloud.documentai.v1.Doc"
349-
+ "ument.Revision.HumanReview\0323\n\013HumanRevie"
350-
+ "w\022\r\n\005state\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB"
351-
+ "\010\n\006source\032\255\001\n\nTextChange\022D\n\013text_anchor\030"
352-
+ "\001 \001(\0132/.google.cloud.documentai.v1.Docum"
353-
+ "ent.TextAnchor\022\024\n\014changed_text\030\002 \001(\t\022C\n\n"
354-
+ "provenance\030\003 \003(\0132/.google.cloud.document"
355-
+ "ai.v1.Document.ProvenanceB\010\n\006sourceB\321\001\n\036"
356-
+ "com.google.cloud.documentai.v1B\rDocument"
357-
+ "ProtoP\001ZDgoogle.golang.org/genproto/goog"
358-
+ "leapis/cloud/documentai/v1;documentai\252\002\032"
359-
+ "Google.Cloud.DocumentAI.V1\312\002\032Google\\Clou"
360-
+ "d\\DocumentAI\\V1\352\002\035Google::Cloud::Documen"
361-
+ "tAI::V1b\006proto3"
331+
+ "ai.v1.BoundingPolyB\003\340A\001\022\027\n\nconfidence\030\005 "
332+
+ "\001(\002B\003\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_TYPE_U"
333+
+ "NSPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010"
334+
+ "\n\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022"
335+
+ "\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\365\002\n\nProvenanc"
336+
+ "e\022\020\n\010revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\022G\n\007paren"
337+
+ "ts\030\003 \003(\01326.google.cloud.documentai.v1.Do"
338+
+ "cument.Provenance.Parent\022K\n\004type\030\004 \001(\0162="
339+
+ ".google.cloud.documentai.v1.Document.Pro"
340+
+ "venance.OperationType\032&\n\006Parent\022\020\n\010revis"
341+
+ "ion\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\"\212\001\n\rOperationType\022"
342+
+ "\036\n\032OPERATION_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001"
343+
+ "\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_REQUES"
344+
+ "TED\020\004\022\021\n\rEVAL_APPROVED\020\005\022\020\n\014EVAL_SKIPPED"
345+
+ "\020\006\032\215\002\n\010Revision\022\017\n\005agent\030\004 \001(\tH\000\022\023\n\tproc"
346+
+ "essor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001(\t\022\016\n\006parent\030\002 \003("
347+
+ "\005\022/\n\013create_time\030\003 \001(\0132\032.google.protobuf"
348+
+ ".Timestamp\022O\n\014human_review\030\006 \001(\01329.googl"
349+
+ "e.cloud.documentai.v1.Document.Revision."
350+
+ "HumanReview\0323\n\013HumanReview\022\r\n\005state\030\001 \001("
351+
+ "\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006source\032\255\001\n\nT"
352+
+ "extChange\022D\n\013text_anchor\030\001 \001(\0132/.google."
353+
+ "cloud.documentai.v1.Document.TextAnchor\022"
354+
+ "\024\n\014changed_text\030\002 \001(\t\022C\n\nprovenance\030\003 \003("
355+
+ "\0132/.google.cloud.documentai.v1.Document."
356+
+ "ProvenanceB\010\n\006sourceB\321\001\n\036com.google.clou"
357+
+ "d.documentai.v1B\rDocumentProtoP\001ZDgoogle"
358+
+ ".golang.org/genproto/googleapis/cloud/do"
359+
+ "cumentai/v1;documentai\252\002\032Google.Cloud.Do"
360+
+ "cumentAI.V1\312\002\032Google\\Cloud\\DocumentAI\\V1"
361+
+ "\352\002\035Google::Cloud::DocumentAI::V1b\006proto3"
362362
};
363363
descriptor =
364364
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -657,7 +657,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
657657
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
658658
internal_static_google_cloud_documentai_v1_Document_PageAnchor_PageRef_descriptor,
659659
new java.lang.String[] {
660-
"Page", "LayoutType", "LayoutId", "BoundingPoly",
660+
"Page", "LayoutType", "LayoutId", "BoundingPoly", "Confidence",
661661
});
662662
internal_static_google_cloud_documentai_v1_Document_Provenance_descriptor =
663663
internal_static_google_cloud_documentai_v1_Document_descriptor.getNestedTypes().get(7);

proto-google-cloud-document-ai-v1/src/main/proto/google/cloud/documentai/v1/document.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ message Document {
549549

550550
// Optional. Identifies the bounding polygon of a layout element on the page.
551551
BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL];
552+
553+
// Optional. Confidence of detected page element, if applicable. Range [0, 1].
554+
float confidence = 5 [(google.api.field_behavior) = OPTIONAL];
552555
}
553556

554557
// One or more references to visual page elements

synth.metadata

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-document-ai.git",
7-
"sha": "03c7a9b10e8c1db2219ada1fbedaa8cc5f5595e2"
7+
"sha": "952106ebcfa227d552beeb84e3fe816223e899a0"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
15-
"internalRef": "370028868"
14+
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
15+
"internalRef": "370513265"
1616
}
1717
},
1818
{
1919
"git": {
2020
"name": "googleapis",
2121
"remote": "https://github.com/googleapis/googleapis.git",
22-
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
23-
"internalRef": "370028868"
22+
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
23+
"internalRef": "370513265"
2424
}
2525
},
2626
{
2727
"git": {
2828
"name": "googleapis",
2929
"remote": "https://github.com/googleapis/googleapis.git",
30-
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
31-
"internalRef": "370028868"
30+
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
31+
"internalRef": "370513265"
3232
}
3333
},
3434
{
3535
"git": {
3636
"name": "googleapis",
3737
"remote": "https://github.com/googleapis/googleapis.git",
38-
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
39-
"internalRef": "370028868"
38+
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
39+
"internalRef": "370513265"
4040
}
4141
},
4242
{

0 commit comments

Comments
 (0)