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

Commit

Permalink
feat: add confidence field to the PageAnchor.PageRef in document.proto (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
yoshi-automation committed Apr 27, 2021
1 parent ce87c21 commit 2d0772e
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 44 deletions.
Expand Up @@ -42829,6 +42829,19 @@ public interface PageRefOrBuilder
* </code>
*/
com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBuilder();

/**
*
*
* <pre>
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
* </pre>
*
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The confidence.
*/
float getConfidence();
}
/**
*
Expand Down Expand Up @@ -42916,6 +42929,11 @@ private PageRef(
boundingPoly_ = subBuilder.buildPartial();
}

break;
}
case 45:
{
confidence_ = input.readFloat();
break;
}
default:
Expand Down Expand Up @@ -43392,6 +43410,24 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui
return getBoundingPoly();
}

public static final int CONFIDENCE_FIELD_NUMBER = 5;
private float confidence_;
/**
*
*
* <pre>
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
* </pre>
*
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The confidence.
*/
@java.lang.Override
public float getConfidence() {
return confidence_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -43421,6 +43457,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (boundingPoly_ != null) {
output.writeMessage(4, getBoundingPoly());
}
if (confidence_ != 0F) {
output.writeFloat(5, confidence_);
}
unknownFields.writeTo(output);
}

Expand All @@ -43445,6 +43484,9 @@ public int getSerializedSize() {
if (boundingPoly_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getBoundingPoly());
}
if (confidence_ != 0F) {
size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -43468,6 +43510,8 @@ public boolean equals(final java.lang.Object obj) {
if (hasBoundingPoly()) {
if (!getBoundingPoly().equals(other.getBoundingPoly())) return false;
}
if (java.lang.Float.floatToIntBits(getConfidence())
!= java.lang.Float.floatToIntBits(other.getConfidence())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
Expand All @@ -43489,6 +43533,8 @@ public int hashCode() {
hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER;
hash = (53 * hash) + getBoundingPoly().hashCode();
}
hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -43649,6 +43695,8 @@ public Builder clear() {
boundingPoly_ = null;
boundingPolyBuilder_ = null;
}
confidence_ = 0F;

return this;
}

Expand Down Expand Up @@ -43685,6 +43733,7 @@ public com.google.cloud.documentai.v1.Document.PageAnchor.PageRef buildPartial()
} else {
result.boundingPoly_ = boundingPolyBuilder_.build();
}
result.confidence_ = confidence_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -43751,6 +43800,9 @@ public Builder mergeFrom(com.google.cloud.documentai.v1.Document.PageAnchor.Page
if (other.hasBoundingPoly()) {
mergeBoundingPoly(other.getBoundingPoly());
}
if (other.getConfidence() != 0F) {
setConfidence(other.getConfidence());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
Expand Down Expand Up @@ -44263,6 +44315,58 @@ public com.google.cloud.documentai.v1.BoundingPolyOrBuilder getBoundingPolyOrBui
return boundingPolyBuilder_;
}

private float confidence_;
/**
*
*
* <pre>
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
* </pre>
*
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The confidence.
*/
@java.lang.Override
public float getConfidence() {
return confidence_;
}
/**
*
*
* <pre>
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
* </pre>
*
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The confidence to set.
* @return This builder for chaining.
*/
public Builder setConfidence(float value) {

confidence_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Confidence of detected page element, if applicable. Range [0, 1].
* </pre>
*
* <code>float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearConfidence() {

confidence_ = 0F;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
Expand Down
Expand Up @@ -173,7 +173,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ype/date.proto\032\032google/type/datetime.pro"
+ "to\032\027google/type/money.proto\032 google/type"
+ "/postal_address.proto\032\034google/api/annota"
+ "tions.proto\"\2158\n\010Document\022\022\n\003uri\030\001 \001(\tB\003\340"
+ "tions.proto\"\2468\n\010Document\022\022\n\003uri\030\001 \001(\tB\003\340"
+ "A\001H\000\022\026\n\007content\030\002 \001(\014B\003\340A\001H\000\022\021\n\tmime_typ"
+ "e\030\003 \001(\t\022\021\n\004text\030\004 \001(\tB\003\340A\001\022?\n\013text_style"
+ "s\030\005 \003(\0132*.google.cloud.documentai.v1.Doc"
Expand Down Expand Up @@ -320,45 +320,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "ext_segments\030\001 \003(\0132;.google.cloud.docume"
+ "ntai.v1.Document.TextAnchor.TextSegment\022"
+ "\017\n\007content\030\002 \001(\t\0325\n\013TextSegment\022\023\n\013start"
+ "_index\030\001 \001(\003\022\021\n\tend_index\030\002 \001(\003\032\277\003\n\nPage"
+ "_index\030\001 \001(\003\022\021\n\tend_index\030\002 \001(\003\032\330\003\n\nPage"
+ "Anchor\022J\n\tpage_refs\030\001 \003(\01327.google.cloud"
+ ".documentai.v1.Document.PageAnchor.PageR"
+ "ef\032\344\002\n\007PageRef\022\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013lay"
+ "ef\032\375\002\n\007PageRef\022\021\n\004page\030\001 \001(\003B\003\340A\002\022\\\n\013lay"
+ "out_type\030\002 \001(\0162B.google.cloud.documentai"
+ ".v1.Document.PageAnchor.PageRef.LayoutTy"
+ "peB\003\340A\001\022\030\n\tlayout_id\030\003 \001(\tB\005\030\001\340A\001\022D\n\rbou"
+ "nding_poly\030\004 \001(\0132(.google.cloud.document"
+ "ai.v1.BoundingPolyB\003\340A\001\"\207\001\n\nLayoutType\022\033"
+ "\n\027LAYOUT_TYPE_UNSPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r"
+ "\n\tPARAGRAPH\020\002\022\010\n\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VI"
+ "SUAL_ELEMENT\020\005\022\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020"
+ "\007\032\365\002\n\nProvenance\022\020\n\010revision\030\001 \001(\005\022\n\n\002id"
+ "\030\002 \001(\005\022G\n\007parents\030\003 \003(\01326.google.cloud.d"
+ "ocumentai.v1.Document.Provenance.Parent\022"
+ "K\n\004type\030\004 \001(\0162=.google.cloud.documentai."
+ "v1.Document.Provenance.OperationType\032&\n\006"
+ "Parent\022\020\n\010revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\"\212\001\n"
+ "\rOperationType\022\036\n\032OPERATION_TYPE_UNSPECI"
+ "FIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003"
+ "\022\022\n\016EVAL_REQUESTED\020\004\022\021\n\rEVAL_APPROVED\020\005\022"
+ "\020\n\014EVAL_SKIPPED\020\006\032\215\002\n\010Revision\022\017\n\005agent\030"
+ "\004 \001(\tH\000\022\023\n\tprocessor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001(\t"
+ "\022\016\n\006parent\030\002 \003(\005\022/\n\013create_time\030\003 \001(\0132\032."
+ "google.protobuf.Timestamp\022O\n\014human_revie"
+ "w\030\006 \001(\01329.google.cloud.documentai.v1.Doc"
+ "ument.Revision.HumanReview\0323\n\013HumanRevie"
+ "w\022\r\n\005state\030\001 \001(\t\022\025\n\rstate_message\030\002 \001(\tB"
+ "\010\n\006source\032\255\001\n\nTextChange\022D\n\013text_anchor\030"
+ "\001 \001(\0132/.google.cloud.documentai.v1.Docum"
+ "ent.TextAnchor\022\024\n\014changed_text\030\002 \001(\t\022C\n\n"
+ "provenance\030\003 \003(\0132/.google.cloud.document"
+ "ai.v1.Document.ProvenanceB\010\n\006sourceB\321\001\n\036"
+ "com.google.cloud.documentai.v1B\rDocument"
+ "ProtoP\001ZDgoogle.golang.org/genproto/goog"
+ "leapis/cloud/documentai/v1;documentai\252\002\032"
+ "Google.Cloud.DocumentAI.V1\312\002\032Google\\Clou"
+ "d\\DocumentAI\\V1\352\002\035Google::Cloud::Documen"
+ "tAI::V1b\006proto3"
+ "ai.v1.BoundingPolyB\003\340A\001\022\027\n\nconfidence\030\005 "
+ "\001(\002B\003\340A\001\"\207\001\n\nLayoutType\022\033\n\027LAYOUT_TYPE_U"
+ "NSPECIFIED\020\000\022\t\n\005BLOCK\020\001\022\r\n\tPARAGRAPH\020\002\022\010"
+ "\n\004LINE\020\003\022\t\n\005TOKEN\020\004\022\022\n\016VISUAL_ELEMENT\020\005\022"
+ "\t\n\005TABLE\020\006\022\016\n\nFORM_FIELD\020\007\032\365\002\n\nProvenanc"
+ "e\022\020\n\010revision\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\022G\n\007paren"
+ "ts\030\003 \003(\01326.google.cloud.documentai.v1.Do"
+ "cument.Provenance.Parent\022K\n\004type\030\004 \001(\0162="
+ ".google.cloud.documentai.v1.Document.Pro"
+ "venance.OperationType\032&\n\006Parent\022\020\n\010revis"
+ "ion\030\001 \001(\005\022\n\n\002id\030\002 \001(\005\"\212\001\n\rOperationType\022"
+ "\036\n\032OPERATION_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001"
+ "\022\n\n\006REMOVE\020\002\022\013\n\007REPLACE\020\003\022\022\n\016EVAL_REQUES"
+ "TED\020\004\022\021\n\rEVAL_APPROVED\020\005\022\020\n\014EVAL_SKIPPED"
+ "\020\006\032\215\002\n\010Revision\022\017\n\005agent\030\004 \001(\tH\000\022\023\n\tproc"
+ "essor\030\005 \001(\tH\000\022\n\n\002id\030\001 \001(\t\022\016\n\006parent\030\002 \003("
+ "\005\022/\n\013create_time\030\003 \001(\0132\032.google.protobuf"
+ ".Timestamp\022O\n\014human_review\030\006 \001(\01329.googl"
+ "e.cloud.documentai.v1.Document.Revision."
+ "HumanReview\0323\n\013HumanReview\022\r\n\005state\030\001 \001("
+ "\t\022\025\n\rstate_message\030\002 \001(\tB\010\n\006source\032\255\001\n\nT"
+ "extChange\022D\n\013text_anchor\030\001 \001(\0132/.google."
+ "cloud.documentai.v1.Document.TextAnchor\022"
+ "\024\n\014changed_text\030\002 \001(\t\022C\n\nprovenance\030\003 \003("
+ "\0132/.google.cloud.documentai.v1.Document."
+ "ProvenanceB\010\n\006sourceB\321\001\n\036com.google.clou"
+ "d.documentai.v1B\rDocumentProtoP\001ZDgoogle"
+ ".golang.org/genproto/googleapis/cloud/do"
+ "cumentai/v1;documentai\252\002\032Google.Cloud.Do"
+ "cumentAI.V1\312\002\032Google\\Cloud\\DocumentAI\\V1"
+ "\352\002\035Google::Cloud::DocumentAI::V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down Expand Up @@ -657,7 +657,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_documentai_v1_Document_PageAnchor_PageRef_descriptor,
new java.lang.String[] {
"Page", "LayoutType", "LayoutId", "BoundingPoly",
"Page", "LayoutType", "LayoutId", "BoundingPoly", "Confidence",
});
internal_static_google_cloud_documentai_v1_Document_Provenance_descriptor =
internal_static_google_cloud_documentai_v1_Document_descriptor.getNestedTypes().get(7);
Expand Down
Expand Up @@ -549,6 +549,9 @@ message Document {

// Optional. Identifies the bounding polygon of a layout element on the page.
BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Confidence of detected page element, if applicable. Range [0, 1].
float confidence = 5 [(google.api.field_behavior) = OPTIONAL];
}

// One or more references to visual page elements
Expand Down
18 changes: 9 additions & 9 deletions synth.metadata
Expand Up @@ -4,39 +4,39 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-document-ai.git",
"sha": "03c7a9b10e8c1db2219ada1fbedaa8cc5f5595e2"
"sha": "952106ebcfa227d552beeb84e3fe816223e899a0"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
"internalRef": "370028868"
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
"internalRef": "370513265"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
"internalRef": "370028868"
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
"internalRef": "370513265"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
"internalRef": "370028868"
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
"internalRef": "370513265"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f07131004bbcab3737d1241b34341d1b76ae7712",
"internalRef": "370028868"
"sha": "7713e2e860003a84b35b701de29dd0769795e1e3",
"internalRef": "370513265"
}
},
{
Expand Down

0 comments on commit 2d0772e

Please sign in to comment.