diff --git a/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java index 40dbf4f7fc2b..671266d61f3a 100644 --- a/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java +++ b/google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceGrpc.java @@ -198,12 +198,14 @@ public void predict( * * *
-     * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
      * prediction result won't be immediately available in the response. Instead,
      * a long running operation object is returned. User can poll the operation
      * result via [GetOperation][google.longrunning.Operations.GetOperation]
-     * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in
-     * the [response][google.longrunning.Operation.response] field.
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is
+     * returned in the [response][google.longrunning.Operation.response] field.
      * Available for following ML problems:
      * * Image Classification
      * * Image Object Detection
@@ -300,12 +302,14 @@ public void predict(
      *
      *
      * 
-     * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
      * prediction result won't be immediately available in the response. Instead,
      * a long running operation object is returned. User can poll the operation
      * result via [GetOperation][google.longrunning.Operations.GetOperation]
-     * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in
-     * the [response][google.longrunning.Operation.response] field.
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is
+     * returned in the [response][google.longrunning.Operation.response] field.
      * Available for following ML problems:
      * * Image Classification
      * * Image Object Detection
@@ -383,12 +387,14 @@ public com.google.cloud.automl.v1beta1.PredictResponse predict(
      *
      *
      * 
-     * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
      * prediction result won't be immediately available in the response. Instead,
      * a long running operation object is returned. User can poll the operation
      * result via [GetOperation][google.longrunning.Operations.GetOperation]
-     * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in
-     * the [response][google.longrunning.Operation.response] field.
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is
+     * returned in the [response][google.longrunning.Operation.response] field.
      * Available for following ML problems:
      * * Image Classification
      * * Image Object Detection
@@ -464,12 +470,14 @@ protected PredictionServiceFutureStub build(
      *
      *
      * 
-     * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
+     * Perform a batch prediction. Unlike the online
+     * [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch
      * prediction result won't be immediately available in the response. Instead,
      * a long running operation object is returned. User can poll the operation
      * result via [GetOperation][google.longrunning.Operations.GetOperation]
-     * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in
-     * the [response][google.longrunning.Operation.response] field.
+     * method. Once the operation is done,
+     * [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is
+     * returned in the [response][google.longrunning.Operation.response] field.
      * Available for following ML problems:
      * * Image Classification
      * * Image Object Detection
diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictRequest.java
index d919f82ac05c..ec179a0113bd 100644
--- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictRequest.java
+++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictRequest.java
@@ -7,7 +7,8 @@
  *
  *
  * 
- * Request message for [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
+ * Request message for
+ * [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
  * 
* * Protobuf type {@code google.cloud.automl.v1beta1.BatchPredictRequest} @@ -793,7 +794,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request message for [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
+   * Request message for
+   * [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
    * 
* * Protobuf type {@code google.cloud.automl.v1beta1.BatchPredictRequest} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictResult.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictResult.java index 87e8a97dbf7a..b3bdcdfda53e 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictResult.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/BatchPredictResult.java @@ -9,7 +9,8 @@ *
  * Result of the Batch Predict. This message is returned in
  * [response][google.longrunning.Operation.response] of the operation returned
- * by the [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
+ * by the
+ * [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
  * 
* * Protobuf type {@code google.cloud.automl.v1beta1.BatchPredictResult} @@ -401,7 +402,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * Result of the Batch Predict. This message is returned in
    * [response][google.longrunning.Operation.response] of the operation returned
-   * by the [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
+   * by the
+   * [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict].
    * 
* * Protobuf type {@code google.cloud.automl.v1beta1.BatchPredictResult} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java index 0990b9dc6177..3098c097cd82 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DataItems.java @@ -20,10 +20,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_automl_v1beta1_TextSnippet_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1beta1_TextSnippet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_DocumentDimensions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1beta1_Document_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_automl_v1beta1_Document_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_automl_v1beta1_Document_Layout_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_automl_v1beta1_Row_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -42,31 +50,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n,google/cloud/automl/v1beta1/data_items" - + ".proto\022\033google.cloud.automl.v1beta1\032$goo" - + "gle/cloud/automl/v1beta1/io.proto\032\031googl" - + "e/protobuf/any.proto\032\036google/protobuf/du" - + "ration.proto\032\034google/protobuf/struct.pro" - + "to\032\034google/api/annotations.proto\"\177\n\005Imag" - + "e\022\025\n\013image_bytes\030\001 \001(\014H\000\022@\n\014input_config" - + "\030\006 \001(\0132(.google.cloud.automl.v1beta1.Inp" - + "utConfigH\000\022\025\n\rthumbnail_uri\030\004 \001(\tB\006\n\004dat" - + "a\"F\n\013TextSnippet\022\017\n\007content\030\001 \001(\t\022\021\n\tmim" - + "e_type\030\002 \001(\t\022\023\n\013content_uri\030\004 \001(\t\"R\n\010Doc" - + "ument\022F\n\014input_config\030\001 \001(\01320.google.clo" - + "ud.automl.v1beta1.DocumentInputConfig\"F\n" - + "\003Row\022\027\n\017column_spec_ids\030\002 \003(\t\022&\n\006values\030" - + "\003 \003(\0132\026.google.protobuf.Value\"\376\001\n\016Exampl" - + "ePayload\0223\n\005image\030\001 \001(\0132\".google.cloud.a" - + "utoml.v1beta1.ImageH\000\022@\n\014text_snippet\030\002 " - + "\001(\0132(.google.cloud.automl.v1beta1.TextSn" - + "ippetH\000\0229\n\010document\030\004 \001(\0132%.google.cloud" - + ".automl.v1beta1.DocumentH\000\022/\n\003row\030\003 \001(\0132" - + " .google.cloud.automl.v1beta1.RowH\000B\t\n\007p" - + "ayloadB\245\001\n\037com.google.cloud.automl.v1bet" - + "a1P\001ZAgoogle.golang.org/genproto/googlea" - + "pis/cloud/automl/v1beta1;automl\312\002\033Google" - + "\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::A" - + "utoML::V1beta1b\006proto3" + + ".proto\022\033google.cloud.automl.v1beta1\032\034goo" + + "gle/api/annotations.proto\032*google/cloud/" + + "automl/v1beta1/geometry.proto\032$google/cl" + + "oud/automl/v1beta1/io.proto\032.google/clou" + + "d/automl/v1beta1/text_segment.proto\032\031goo" + + "gle/protobuf/any.proto\032\036google/protobuf/" + + "duration.proto\032\034google/protobuf/struct.p" + + "roto\"\177\n\005Image\022\025\n\013image_bytes\030\001 \001(\014H\000\022@\n\014" + + "input_config\030\006 \001(\0132(.google.cloud.automl" + + ".v1beta1.InputConfigH\000\022\025\n\rthumbnail_uri\030" + + "\004 \001(\tB\006\n\004data\"F\n\013TextSnippet\022\017\n\007content\030" + + "\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\022\023\n\013content_uri\030" + + "\004 \001(\t\"\357\001\n\022DocumentDimensions\022S\n\004unit\030\001 \001" + + "(\0162E.google.cloud.automl.v1beta1.Documen" + + "tDimensions.DocumentDimensionUnit\022\r\n\005wid" + + "th\030\002 \001(\002\022\016\n\006height\030\003 \001(\002\"e\n\025DocumentDime" + + "nsionUnit\022\'\n#DOCUMENT_DIMENSION_UNIT_UNS" + + "PECIFIED\020\000\022\010\n\004INCH\020\001\022\016\n\nCENTIMETER\020\002\022\t\n\005" + + "POINT\020\003\"\371\005\n\010Document\022F\n\014input_config\030\001 \001" + + "(\01320.google.cloud.automl.v1beta1.Documen" + + "tInputConfig\022?\n\rdocument_text\030\002 \001(\0132(.go" + + "ogle.cloud.automl.v1beta1.TextSnippet\022<\n" + + "\006layout\030\003 \003(\0132,.google.cloud.automl.v1be" + + "ta1.Document.Layout\022L\n\023document_dimensio" + + "ns\030\004 \001(\0132/.google.cloud.automl.v1beta1.D" + + "ocumentDimensions\022\022\n\npage_count\030\005 \001(\005\032\303\003" + + "\n\006Layout\022>\n\014text_segment\030\001 \001(\0132(.google." + + "cloud.automl.v1beta1.TextSegment\022\023\n\013page" + + "_number\030\002 \001(\005\022@\n\rbounding_poly\030\003 \001(\0132).g" + + "oogle.cloud.automl.v1beta1.BoundingPoly\022" + + "W\n\021text_segment_type\030\004 \001(\0162<.google.clou" + + "d.automl.v1beta1.Document.Layout.TextSeg" + + "mentType\"\310\001\n\017TextSegmentType\022!\n\035TEXT_SEG" + + "MENT_TYPE_UNSPECIFIED\020\000\022\t\n\005TOKEN\020\001\022\r\n\tPA" + + "RAGRAPH\020\002\022\016\n\nFORM_FIELD\020\003\022\023\n\017FORM_FIELD_" + + "NAME\020\004\022\027\n\023FORM_FIELD_CONTENTS\020\005\022\t\n\005TABLE" + + "\020\006\022\020\n\014TABLE_HEADER\020\007\022\r\n\tTABLE_ROW\020\010\022\016\n\nT" + + "ABLE_CELL\020\t\"F\n\003Row\022\027\n\017column_spec_ids\030\002 " + + "\003(\t\022&\n\006values\030\003 \003(\0132\026.google.protobuf.Va" + + "lue\"\376\001\n\016ExamplePayload\0223\n\005image\030\001 \001(\0132\"." + + "google.cloud.automl.v1beta1.ImageH\000\022@\n\014t" + + "ext_snippet\030\002 \001(\0132(.google.cloud.automl." + + "v1beta1.TextSnippetH\000\0229\n\010document\030\004 \001(\0132" + + "%.google.cloud.automl.v1beta1.DocumentH\000" + + "\022/\n\003row\030\003 \001(\0132 .google.cloud.automl.v1be" + + "ta1.RowH\000B\t\n\007payloadB\245\001\n\037com.google.clou" + + "d.automl.v1beta1P\001ZAgoogle.golang.org/ge" + + "nproto/googleapis/cloud/automl/v1beta1;a" + + "utoml\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Go" + + "ogle::Cloud::AutoML::V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -79,11 +112,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.automl.v1beta1.Geometry.getDescriptor(), com.google.cloud.automl.v1beta1.Io.getDescriptor(), + com.google.cloud.automl.v1beta1.TextSegmentProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }, assigner); internal_static_google_cloud_automl_v1beta1_Image_descriptor = @@ -102,16 +137,32 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "Content", "MimeType", "ContentUri", }); - internal_static_google_cloud_automl_v1beta1_Document_descriptor = + internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_automl_v1beta1_DocumentDimensions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor, + new java.lang.String[] { + "Unit", "Width", "Height", + }); + internal_static_google_cloud_automl_v1beta1_Document_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_automl_v1beta1_Document_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_Document_descriptor, new java.lang.String[] { - "InputConfig", + "InputConfig", "DocumentText", "Layout", "DocumentDimensions", "PageCount", + }); + internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor = + internal_static_google_cloud_automl_v1beta1_Document_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_automl_v1beta1_Document_Layout_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor, + new java.lang.String[] { + "TextSegment", "PageNumber", "BoundingPoly", "TextSegmentType", }); internal_static_google_cloud_automl_v1beta1_Row_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_automl_v1beta1_Row_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_Row_descriptor, @@ -119,18 +170,20 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( "ColumnSpecIds", "Values", }); internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_automl_v1beta1_ExamplePayload_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_automl_v1beta1_ExamplePayload_descriptor, new java.lang.String[] { "Image", "TextSnippet", "Document", "Row", "Payload", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.automl.v1beta1.Geometry.getDescriptor(); com.google.cloud.automl.v1beta1.Io.getDescriptor(); + com.google.cloud.automl.v1beta1.TextSegmentProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Document.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Document.java index 18f3be1c62a6..86ef40f742f5 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Document.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/Document.java @@ -22,7 +22,9 @@ private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Document() {} + private Document() { + layout_ = java.util.Collections.emptyList(); + } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { @@ -63,6 +65,56 @@ private Document( inputConfig_ = subBuilder.buildPartial(); } + break; + } + case 18: + { + com.google.cloud.automl.v1beta1.TextSnippet.Builder subBuilder = null; + if (documentText_ != null) { + subBuilder = documentText_.toBuilder(); + } + documentText_ = + input.readMessage( + com.google.cloud.automl.v1beta1.TextSnippet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentText_); + documentText_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + layout_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + layout_.add( + input.readMessage( + com.google.cloud.automl.v1beta1.Document.Layout.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder subBuilder = null; + if (documentDimensions_ != null) { + subBuilder = documentDimensions_.toBuilder(); + } + documentDimensions_ = + input.readMessage( + com.google.cloud.automl.v1beta1.DocumentDimensions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(documentDimensions_); + documentDimensions_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + pageCount_ = input.readInt32(); break; } default: @@ -79,6 +131,9 @@ private Document( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + layout_ = java.util.Collections.unmodifiableList(layout_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -99,428 +154,3250 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.automl.v1beta1.Document.Builder.class); } - public static final int INPUT_CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.automl.v1beta1.DocumentInputConfig inputConfig_; - /** - * - * - *
-   * An input config specifying the content of the document.
-   * 
- * - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; - */ - public boolean hasInputConfig() { - return inputConfig_ != null; - } - /** - * - * - *
-   * An input config specifying the content of the document.
-   * 
- * - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; - */ - public com.google.cloud.automl.v1beta1.DocumentInputConfig getInputConfig() { - return inputConfig_ == null - ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() - : inputConfig_; + public interface LayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.Document.Layout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + boolean hasTextSegment(); + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + com.google.cloud.automl.v1beta1.TextSegment getTextSegment(); + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + com.google.cloud.automl.v1beta1.TextSegmentOrBuilder getTextSegmentOrBuilder(); + + /** + * + * + *
+     * Page number of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the original document, starts from 1.
+     * 
+ * + * int32 page_number = 2; + */ + int getPageNumber(); + + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + boolean hasBoundingPoly(); + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + com.google.cloud.automl.v1beta1.BoundingPoly getBoundingPoly(); + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder(); + + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in document.
+     * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + int getTextSegmentTypeValue(); + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in document.
+     * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType getTextSegmentType(); } /** * * *
-   * An input config specifying the content of the document.
+   * Describes the layout information of a
+   * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in
+   * the document.
    * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * Protobuf type {@code google.cloud.automl.v1beta1.Document.Layout} */ - public com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { - return getInputConfig(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public static final class Layout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.Document.Layout) + LayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use Layout.newBuilder() to construct. + private Layout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } - memoizedIsInitialized = 1; - return true; - } + private Layout() { + textSegmentType_ = 0; + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (inputConfig_ != null) { - output.writeMessage(1, getInputConfig()); + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private Layout( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.automl.v1beta1.TextSegment.Builder subBuilder = null; + if (textSegment_ != null) { + subBuilder = textSegment_.toBuilder(); + } + textSegment_ = + input.readMessage( + com.google.cloud.automl.v1beta1.TextSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(textSegment_); + textSegment_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + pageNumber_ = input.readInt32(); + break; + } + case 26: + { + com.google.cloud.automl.v1beta1.BoundingPoly.Builder subBuilder = null; + if (boundingPoly_ != null) { + subBuilder = boundingPoly_.toBuilder(); + } + boundingPoly_ = + input.readMessage( + com.google.cloud.automl.v1beta1.BoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(boundingPoly_); + boundingPoly_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + int rawValue = input.readEnum(); - size = 0; - if (inputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + textSegmentType_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.automl.v1beta1.Document)) { - return super.equals(obj); + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor; } - com.google.cloud.automl.v1beta1.Document other = (com.google.cloud.automl.v1beta1.Document) obj; - if (hasInputConfig() != other.hasInputConfig()) return false; - if (hasInputConfig()) { - if (!getInputConfig().equals(other.getInputConfig())) return false; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_Layout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Document.Layout.class, + com.google.cloud.automl.v1beta1.Document.Layout.Builder.class); } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasInputConfig()) { - hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getInputConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } + /** + * + * + *
+     * The type of TextSegment in the context of the original document.
+     * 
+ * + * Protobuf enum {@code google.cloud.automl.v1beta1.Document.Layout.TextSegmentType} + */ + public enum TextSegmentType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Should not be used.
+       * 
+ * + * TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + TEXT_SEGMENT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * The text segment is a token. e.g. word.
+       * 
+ * + * TOKEN = 1; + */ + TOKEN(1), + /** + * + * + *
+       * The text segment is a paragraph.
+       * 
+ * + * PARAGRAPH = 2; + */ + PARAGRAPH(2), + /** + * + * + *
+       * The text segment is a form field.
+       * 
+ * + * FORM_FIELD = 3; + */ + FORM_FIELD(3), + /** + * + * + *
+       * The text segment is the name part of a form field. It will be treated
+       * as child of another FORM_FIELD TextSegment if its span is subspan of
+       * another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_NAME = 4; + */ + FORM_FIELD_NAME(4), + /** + * + * + *
+       * The text segment is the text content part of a form field. It will be
+       * treated as child of another FORM_FIELD TextSegment if its span is
+       * subspan of another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_CONTENTS = 5; + */ + FORM_FIELD_CONTENTS(5), + /** + * + * + *
+       * The text segment is a whole table, including headers, and all rows.
+       * 
+ * + * TABLE = 6; + */ + TABLE(6), + /** + * + * + *
+       * The text segment is a table's headers. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_HEADER = 7; + */ + TABLE_HEADER(7), + /** + * + * + *
+       * The text segment is a row in table. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_ROW = 8; + */ + TABLE_ROW(8), + /** + * + * + *
+       * The text segment is a cell in table. It will be treated as child of
+       * another TABLE_ROW TextSegment if its span is subspan of another
+       * TextSegment with type TABLE_ROW.
+       * 
+ * + * TABLE_CELL = 9; + */ + TABLE_CELL(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Should not be used.
+       * 
+ * + * TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + public static final int TEXT_SEGMENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The text segment is a token. e.g. word.
+       * 
+ * + * TOKEN = 1; + */ + public static final int TOKEN_VALUE = 1; + /** + * + * + *
+       * The text segment is a paragraph.
+       * 
+ * + * PARAGRAPH = 2; + */ + public static final int PARAGRAPH_VALUE = 2; + /** + * + * + *
+       * The text segment is a form field.
+       * 
+ * + * FORM_FIELD = 3; + */ + public static final int FORM_FIELD_VALUE = 3; + /** + * + * + *
+       * The text segment is the name part of a form field. It will be treated
+       * as child of another FORM_FIELD TextSegment if its span is subspan of
+       * another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_NAME = 4; + */ + public static final int FORM_FIELD_NAME_VALUE = 4; + /** + * + * + *
+       * The text segment is the text content part of a form field. It will be
+       * treated as child of another FORM_FIELD TextSegment if its span is
+       * subspan of another TextSegment with type FORM_FIELD.
+       * 
+ * + * FORM_FIELD_CONTENTS = 5; + */ + public static final int FORM_FIELD_CONTENTS_VALUE = 5; + /** + * + * + *
+       * The text segment is a whole table, including headers, and all rows.
+       * 
+ * + * TABLE = 6; + */ + public static final int TABLE_VALUE = 6; + /** + * + * + *
+       * The text segment is a table's headers. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_HEADER = 7; + */ + public static final int TABLE_HEADER_VALUE = 7; + /** + * + * + *
+       * The text segment is a row in table. It will be treated as child of
+       * another TABLE TextSegment if its span is subspan of another TextSegment
+       * with type TABLE.
+       * 
+ * + * TABLE_ROW = 8; + */ + public static final int TABLE_ROW_VALUE = 8; + /** + * + * + *
+       * The text segment is a cell in table. It will be treated as child of
+       * another TABLE_ROW TextSegment if its span is subspan of another
+       * TextSegment with type TABLE_ROW.
+       * 
+ * + * TABLE_CELL = 9; + */ + public static final int TABLE_CELL_VALUE = 9; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } - public static com.google.cloud.automl.v1beta1.Document parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static TextSegmentType valueOf(int value) { + return forNumber(value); + } - public static com.google.cloud.automl.v1beta1.Document parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static TextSegmentType forNumber(int value) { + switch (value) { + case 0: + return TEXT_SEGMENT_TYPE_UNSPECIFIED; + case 1: + return TOKEN; + case 2: + return PARAGRAPH; + case 3: + return FORM_FIELD; + case 4: + return FORM_FIELD_NAME; + case 5: + return FORM_FIELD_CONTENTS; + case 6: + return TABLE; + case 7: + return TABLE_HEADER; + case 8: + return TABLE_ROW; + case 9: + return TABLE_CELL; + default: + return null; + } + } - public static com.google.cloud.automl.v1beta1.Document parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } - public static com.google.cloud.automl.v1beta1.Document parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TextSegmentType findValueByNumber(int number) { + return TextSegmentType.forNumber(number); + } + }; - public static com.google.cloud.automl.v1beta1.Document parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } - public static com.google.cloud.automl.v1beta1.Document parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } - public static com.google.cloud.automl.v1beta1.Document parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.automl.v1beta1.Document parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.Document.Layout.getDescriptor() + .getEnumTypes() + .get(0); + } - public static com.google.cloud.automl.v1beta1.Document parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + private static final TextSegmentType[] VALUES = values(); - public static com.google.cloud.automl.v1beta1.Document parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + public static TextSegmentType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } - public static com.google.cloud.automl.v1beta1.Document parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + private final int value; - public static com.google.cloud.automl.v1beta1.Document parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + private TextSegmentType(int value) { + this.value = value; + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1beta1.Document.Layout.TextSegmentType) + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + public static final int TEXT_SEGMENT_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1beta1.TextSegment textSegment_; + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public boolean hasTextSegment() { + return textSegment_ != null; + } + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1beta1.TextSegment getTextSegment() { + return textSegment_ == null + ? com.google.cloud.automl.v1beta1.TextSegment.getDefaultInstance() + : textSegment_; + } + /** + * + * + *
+     * Text Segment that represents a segment in
+     * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1beta1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + return getTextSegment(); + } - public static Builder newBuilder(com.google.cloud.automl.v1beta1.Document prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + public static final int PAGE_NUMBER_FIELD_NUMBER = 2; + private int pageNumber_; + /** + * + * + *
+     * Page number of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the original document, starts from 1.
+     * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + public static final int BOUNDING_POLY_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1beta1.BoundingPoly boundingPoly_; + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public boolean hasBoundingPoly() { + return boundingPoly_ != null; + } + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1beta1.BoundingPoly getBoundingPoly() { + return boundingPoly_ == null + ? com.google.cloud.automl.v1beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + /** + * + * + *
+     * The position of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in the page. Contains exactly 4
+     * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+     * and they are connected by edges in the order provided, which will
+     * represent a rectangle parallel to the frame. The
+     * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+     * relative to the page.
+     * Coordinates are based on top-left as point (0,0).
+     * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + return getBoundingPoly(); + } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * A structured text document e.g. a PDF.
-   * 
- * - * Protobuf type {@code google.cloud.automl.v1beta1.Document} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Document) - com.google.cloud.automl.v1beta1.DocumentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.automl.v1beta1.DataItems - .internal_static_google_cloud_automl_v1beta1_Document_descriptor; + public static final int TEXT_SEGMENT_TYPE_FIELD_NUMBER = 4; + private int textSegmentType_; + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in document.
+     * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public int getTextSegmentTypeValue() { + return textSegmentType_; + } + /** + * + * + *
+     * The type of the
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+     * in document.
+     * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType getTextSegmentType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType result = + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType.valueOf(textSegmentType_); + return result == null + ? com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType.UNRECOGNIZED + : result; } + private byte memoizedIsInitialized = -1; + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.automl.v1beta1.DataItems - .internal_static_google_cloud_automl_v1beta1_Document_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.automl.v1beta1.Document.class, - com.google.cloud.automl.v1beta1.Document.Builder.class); + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; } - // Construct using com.google.cloud.automl.v1beta1.Document.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (textSegment_ != null) { + output.writeMessage(1, getTextSegment()); + } + if (pageNumber_ != 0) { + output.writeInt32(2, pageNumber_); + } + if (boundingPoly_ != null) { + output.writeMessage(3, getBoundingPoly()); + } + if (textSegmentType_ + != com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType + .TEXT_SEGMENT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, textSegmentType_); + } + unknownFields.writeTo(output); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (textSegment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTextSegment()); + } + if (pageNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageNumber_); + } + if (boundingPoly_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBoundingPoly()); + } + if (textSegmentType_ + != com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType + .TEXT_SEGMENT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, textSegmentType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.Document.Layout)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.Document.Layout other = + (com.google.cloud.automl.v1beta1.Document.Layout) obj; + + if (hasTextSegment() != other.hasTextSegment()) return false; + if (hasTextSegment()) { + if (!getTextSegment().equals(other.getTextSegment())) return false; + } + if (getPageNumber() != other.getPageNumber()) return false; + if (hasBoundingPoly() != other.hasBoundingPoly()) return false; + if (hasBoundingPoly()) { + if (!getBoundingPoly().equals(other.getBoundingPoly())) return false; + } + if (textSegmentType_ != other.textSegmentType_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } @java.lang.Override - public Builder clear() { - super.clear(); - if (inputConfigBuilder_ == null) { - inputConfig_ = null; - } else { - inputConfig_ = null; - inputConfigBuilder_ = null; + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - return this; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTextSegment()) { + hash = (37 * hash) + TEXT_SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getTextSegment().hashCode(); + } + hash = (37 * hash) + PAGE_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getPageNumber(); + if (hasBoundingPoly()) { + hash = (37 * hash) + BOUNDING_POLY_FIELD_NUMBER; + hash = (53 * hash) + getBoundingPoly().hashCode(); + } + hash = (37 * hash) + TEXT_SEGMENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + textSegmentType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.automl.v1beta1.DataItems - .internal_static_google_cloud_automl_v1beta1_Document_descriptor; + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.automl.v1beta1.Document.Layout prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override - public com.google.cloud.automl.v1beta1.Document getDefaultInstanceForType() { - return com.google.cloud.automl.v1beta1.Document.getDefaultInstance(); + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public com.google.cloud.automl.v1beta1.Document build() { - com.google.cloud.automl.v1beta1.Document result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes the layout information of a
+     * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in
+     * the document.
+     * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.Document.Layout} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Document.Layout) + com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_Layout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Document.Layout.class, + com.google.cloud.automl.v1beta1.Document.Layout.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.Document.Layout.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (textSegmentBuilder_ == null) { + textSegment_ = null; + } else { + textSegment_ = null; + textSegmentBuilder_ = null; + } + pageNumber_ = 0; + + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + textSegmentType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_Layout_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document.Layout getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.Document.Layout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document.Layout build() { + com.google.cloud.automl.v1beta1.Document.Layout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document.Layout buildPartial() { + com.google.cloud.automl.v1beta1.Document.Layout result = + new com.google.cloud.automl.v1beta1.Document.Layout(this); + if (textSegmentBuilder_ == null) { + result.textSegment_ = textSegment_; + } else { + result.textSegment_ = textSegmentBuilder_.build(); + } + result.pageNumber_ = pageNumber_; + if (boundingPolyBuilder_ == null) { + result.boundingPoly_ = boundingPoly_; + } else { + result.boundingPoly_ = boundingPolyBuilder_.build(); + } + result.textSegmentType_ = textSegmentType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.Document.Layout) { + return mergeFrom((com.google.cloud.automl.v1beta1.Document.Layout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.Document.Layout other) { + if (other == com.google.cloud.automl.v1beta1.Document.Layout.getDefaultInstance()) + return this; + if (other.hasTextSegment()) { + mergeTextSegment(other.getTextSegment()); + } + if (other.getPageNumber() != 0) { + setPageNumber(other.getPageNumber()); + } + if (other.hasBoundingPoly()) { + mergeBoundingPoly(other.getBoundingPoly()); + } + if (other.textSegmentType_ != 0) { + setTextSegmentTypeValue(other.getTextSegmentTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.Document.Layout parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1beta1.Document.Layout) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.automl.v1beta1.TextSegment textSegment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSegment, + com.google.cloud.automl.v1beta1.TextSegment.Builder, + com.google.cloud.automl.v1beta1.TextSegmentOrBuilder> + textSegmentBuilder_; + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public boolean hasTextSegment() { + return textSegmentBuilder_ != null || textSegment_ != null; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1beta1.TextSegment getTextSegment() { + if (textSegmentBuilder_ == null) { + return textSegment_ == null + ? com.google.cloud.automl.v1beta1.TextSegment.getDefaultInstance() + : textSegment_; + } else { + return textSegmentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public Builder setTextSegment(com.google.cloud.automl.v1beta1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textSegment_ = value; + onChanged(); + } else { + textSegmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public Builder setTextSegment( + com.google.cloud.automl.v1beta1.TextSegment.Builder builderForValue) { + if (textSegmentBuilder_ == null) { + textSegment_ = builderForValue.build(); + onChanged(); + } else { + textSegmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public Builder mergeTextSegment(com.google.cloud.automl.v1beta1.TextSegment value) { + if (textSegmentBuilder_ == null) { + if (textSegment_ != null) { + textSegment_ = + com.google.cloud.automl.v1beta1.TextSegment.newBuilder(textSegment_) + .mergeFrom(value) + .buildPartial(); + } else { + textSegment_ = value; + } + onChanged(); + } else { + textSegmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public Builder clearTextSegment() { + if (textSegmentBuilder_ == null) { + textSegment_ = null; + onChanged(); + } else { + textSegment_ = null; + textSegmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1beta1.TextSegment.Builder getTextSegmentBuilder() { + + onChanged(); + return getTextSegmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + public com.google.cloud.automl.v1beta1.TextSegmentOrBuilder getTextSegmentOrBuilder() { + if (textSegmentBuilder_ != null) { + return textSegmentBuilder_.getMessageOrBuilder(); + } else { + return textSegment_ == null + ? com.google.cloud.automl.v1beta1.TextSegment.getDefaultInstance() + : textSegment_; + } + } + /** + * + * + *
+       * Text Segment that represents a segment in
+       * [document_text][google.cloud.automl.v1beta1.Document.document_text].
+       * 
+ * + * .google.cloud.automl.v1beta1.TextSegment text_segment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSegment, + com.google.cloud.automl.v1beta1.TextSegment.Builder, + com.google.cloud.automl.v1beta1.TextSegmentOrBuilder> + getTextSegmentFieldBuilder() { + if (textSegmentBuilder_ == null) { + textSegmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSegment, + com.google.cloud.automl.v1beta1.TextSegment.Builder, + com.google.cloud.automl.v1beta1.TextSegmentOrBuilder>( + getTextSegment(), getParentForChildren(), isClean()); + textSegment_ = null; + } + return textSegmentBuilder_; + } + + private int pageNumber_; + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public int getPageNumber() { + return pageNumber_; + } + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public Builder setPageNumber(int value) { + + pageNumber_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Page number of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the original document, starts from 1.
+       * 
+ * + * int32 page_number = 2; + */ + public Builder clearPageNumber() { + + pageNumber_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.automl.v1beta1.BoundingPoly boundingPoly_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.BoundingPoly, + com.google.cloud.automl.v1beta1.BoundingPoly.Builder, + com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder> + boundingPolyBuilder_; + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public boolean hasBoundingPoly() { + return boundingPolyBuilder_ != null || boundingPoly_ != null; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1beta1.BoundingPoly getBoundingPoly() { + if (boundingPolyBuilder_ == null) { + return boundingPoly_ == null + ? com.google.cloud.automl.v1beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } else { + return boundingPolyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public Builder setBoundingPoly(com.google.cloud.automl.v1beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boundingPoly_ = value; + onChanged(); + } else { + boundingPolyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public Builder setBoundingPoly( + com.google.cloud.automl.v1beta1.BoundingPoly.Builder builderForValue) { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = builderForValue.build(); + onChanged(); + } else { + boundingPolyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public Builder mergeBoundingPoly(com.google.cloud.automl.v1beta1.BoundingPoly value) { + if (boundingPolyBuilder_ == null) { + if (boundingPoly_ != null) { + boundingPoly_ = + com.google.cloud.automl.v1beta1.BoundingPoly.newBuilder(boundingPoly_) + .mergeFrom(value) + .buildPartial(); + } else { + boundingPoly_ = value; + } + onChanged(); + } else { + boundingPolyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public Builder clearBoundingPoly() { + if (boundingPolyBuilder_ == null) { + boundingPoly_ = null; + onChanged(); + } else { + boundingPoly_ = null; + boundingPolyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1beta1.BoundingPoly.Builder getBoundingPolyBuilder() { + + onChanged(); + return getBoundingPolyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + public com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder getBoundingPolyOrBuilder() { + if (boundingPolyBuilder_ != null) { + return boundingPolyBuilder_.getMessageOrBuilder(); + } else { + return boundingPoly_ == null + ? com.google.cloud.automl.v1beta1.BoundingPoly.getDefaultInstance() + : boundingPoly_; + } + } + /** + * + * + *
+       * The position of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in the page. Contains exactly 4
+       * [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices]
+       * and they are connected by edges in the order provided, which will
+       * represent a rectangle parallel to the frame. The
+       * [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are
+       * relative to the page.
+       * Coordinates are based on top-left as point (0,0).
+       * 
+ * + * .google.cloud.automl.v1beta1.BoundingPoly bounding_poly = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.BoundingPoly, + com.google.cloud.automl.v1beta1.BoundingPoly.Builder, + com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder> + getBoundingPolyFieldBuilder() { + if (boundingPolyBuilder_ == null) { + boundingPolyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.BoundingPoly, + com.google.cloud.automl.v1beta1.BoundingPoly.Builder, + com.google.cloud.automl.v1beta1.BoundingPolyOrBuilder>( + getBoundingPoly(), getParentForChildren(), isClean()); + boundingPoly_ = null; + } + return boundingPolyBuilder_; + } + + private int textSegmentType_ = 0; + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in document.
+       * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public int getTextSegmentTypeValue() { + return textSegmentType_; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in document.
+       * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public Builder setTextSegmentTypeValue(int value) { + textSegmentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in document.
+       * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType getTextSegmentType() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType result = + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType.valueOf( + textSegmentType_); + return result == null + ? com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in document.
+       * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public Builder setTextSegmentType( + com.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType value) { + if (value == null) { + throw new NullPointerException(); + } + + textSegmentType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the
+       * [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment]
+       * in document.
+       * 
+ * + * .google.cloud.automl.v1beta1.Document.Layout.TextSegmentType text_segment_type = 4; + * + */ + public Builder clearTextSegmentType() { + + textSegmentType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.Document.Layout) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Document.Layout) + private static final com.google.cloud.automl.v1beta1.Document.Layout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.Document.Layout(); + } + + public static com.google.cloud.automl.v1beta1.Document.Layout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Layout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Layout(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document.Layout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int INPUT_CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.automl.v1beta1.DocumentInputConfig inputConfig_; + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfig_ != null; + } + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentInputConfig getInputConfig() { + return inputConfig_ == null + ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } + /** + * + * + *
+   * An input config specifying the content of the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { + return getInputConfig(); + } + + public static final int DOCUMENT_TEXT_FIELD_NUMBER = 2; + private com.google.cloud.automl.v1beta1.TextSnippet documentText_; + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public boolean hasDocumentText() { + return documentText_ != null; + } + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getDocumentText() { + return documentText_ == null + ? com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() + : documentText_; + } + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getDocumentTextOrBuilder() { + return getDocumentText(); + } + + public static final int LAYOUT_FIELD_NUMBER = 3; + private java.util.List layout_; + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public java.util.List getLayoutList() { + return layout_; + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutOrBuilderList() { + return layout_; + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public int getLayoutCount() { + return layout_.size(); + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.Layout getLayout(int index) { + return layout_.get(index); + } + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { + return layout_.get(index); + } + + public static final int DOCUMENT_DIMENSIONS_FIELD_NUMBER = 4; + private com.google.cloud.automl.v1beta1.DocumentDimensions documentDimensions_; + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + public boolean hasDocumentDimensions() { + return documentDimensions_ != null; + } + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1beta1.DocumentDimensions getDocumentDimensions() { + return documentDimensions_ == null + ? com.google.cloud.automl.v1beta1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; + } + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + public com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder + getDocumentDimensionsOrBuilder() { + return getDocumentDimensions(); + } + + public static final int PAGE_COUNT_FIELD_NUMBER = 5; + private int pageCount_; + /** + * + * + *
+   * Number of pages in the document.
+   * 
+ * + * int32 page_count = 5; + */ + public int getPageCount() { + return pageCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (inputConfig_ != null) { + output.writeMessage(1, getInputConfig()); + } + if (documentText_ != null) { + output.writeMessage(2, getDocumentText()); + } + for (int i = 0; i < layout_.size(); i++) { + output.writeMessage(3, layout_.get(i)); + } + if (documentDimensions_ != null) { + output.writeMessage(4, getDocumentDimensions()); + } + if (pageCount_ != 0) { + output.writeInt32(5, pageCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInputConfig()); + } + if (documentText_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocumentText()); + } + for (int i = 0; i < layout_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, layout_.get(i)); + } + if (documentDimensions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentDimensions()); + } + if (pageCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, pageCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.Document)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.Document other = (com.google.cloud.automl.v1beta1.Document) obj; + + if (hasInputConfig() != other.hasInputConfig()) return false; + if (hasInputConfig()) { + if (!getInputConfig().equals(other.getInputConfig())) return false; + } + if (hasDocumentText() != other.hasDocumentText()) return false; + if (hasDocumentText()) { + if (!getDocumentText().equals(other.getDocumentText())) return false; + } + if (!getLayoutList().equals(other.getLayoutList())) return false; + if (hasDocumentDimensions() != other.hasDocumentDimensions()) return false; + if (hasDocumentDimensions()) { + if (!getDocumentDimensions().equals(other.getDocumentDimensions())) return false; + } + if (getPageCount() != other.getPageCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInputConfig()) { + hash = (37 * hash) + INPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInputConfig().hashCode(); + } + if (hasDocumentText()) { + hash = (37 * hash) + DOCUMENT_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getDocumentText().hashCode(); + } + if (getLayoutCount() > 0) { + hash = (37 * hash) + LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getLayoutList().hashCode(); + } + if (hasDocumentDimensions()) { + hash = (37 * hash) + DOCUMENT_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentDimensions().hashCode(); + } + hash = (37 * hash) + PAGE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPageCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.Document parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.automl.v1beta1.Document prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A structured text document e.g. a PDF.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.Document} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.Document) + com.google.cloud.automl.v1beta1.DocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.Document.class, + com.google.cloud.automl.v1beta1.Document.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.Document.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLayoutFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + if (documentTextBuilder_ == null) { + documentText_ = null; + } else { + documentText_ = null; + documentTextBuilder_ = null; + } + if (layoutBuilder_ == null) { + layout_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + layoutBuilder_.clear(); + } + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = null; + } else { + documentDimensions_ = null; + documentDimensionsBuilder_ = null; + } + pageCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_Document_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.Document.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document build() { + com.google.cloud.automl.v1beta1.Document result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.Document buildPartial() { + com.google.cloud.automl.v1beta1.Document result = + new com.google.cloud.automl.v1beta1.Document(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (inputConfigBuilder_ == null) { + result.inputConfig_ = inputConfig_; + } else { + result.inputConfig_ = inputConfigBuilder_.build(); + } + if (documentTextBuilder_ == null) { + result.documentText_ = documentText_; + } else { + result.documentText_ = documentTextBuilder_.build(); + } + if (layoutBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + layout_ = java.util.Collections.unmodifiableList(layout_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.layout_ = layout_; + } else { + result.layout_ = layoutBuilder_.build(); + } + if (documentDimensionsBuilder_ == null) { + result.documentDimensions_ = documentDimensions_; + } else { + result.documentDimensions_ = documentDimensionsBuilder_.build(); + } + result.pageCount_ = pageCount_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.Document) { + return mergeFrom((com.google.cloud.automl.v1beta1.Document) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.Document other) { + if (other == com.google.cloud.automl.v1beta1.Document.getDefaultInstance()) return this; + if (other.hasInputConfig()) { + mergeInputConfig(other.getInputConfig()); + } + if (other.hasDocumentText()) { + mergeDocumentText(other.getDocumentText()); + } + if (layoutBuilder_ == null) { + if (!other.layout_.isEmpty()) { + if (layout_.isEmpty()) { + layout_ = other.layout_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLayoutIsMutable(); + layout_.addAll(other.layout_); + } + onChanged(); + } + } else { + if (!other.layout_.isEmpty()) { + if (layoutBuilder_.isEmpty()) { + layoutBuilder_.dispose(); + layoutBuilder_ = null; + layout_ = other.layout_; + bitField0_ = (bitField0_ & ~0x00000004); + layoutBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLayoutFieldBuilder() + : null; + } else { + layoutBuilder_.addAllMessages(other.layout_); + } + } + } + if (other.hasDocumentDimensions()) { + mergeDocumentDimensions(other.getDocumentDimensions()); + } + if (other.getPageCount() != 0) { + setPageCount(other.getPageCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.Document parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.automl.v1beta1.Document) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.automl.v1beta1.DocumentInputConfig inputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.DocumentInputConfig, + com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder> + inputConfigBuilder_; + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public boolean hasInputConfig() { + return inputConfigBuilder_ != null || inputConfig_ != null; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentInputConfig getInputConfig() { + if (inputConfigBuilder_ == null) { + return inputConfig_ == null + ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } else { + return inputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public Builder setInputConfig(com.google.cloud.automl.v1beta1.DocumentInputConfig value) { + if (inputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputConfig_ = value; + onChanged(); + } else { + inputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public Builder setInputConfig( + com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder builderForValue) { + if (inputConfigBuilder_ == null) { + inputConfig_ = builderForValue.build(); + onChanged(); + } else { + inputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public Builder mergeInputConfig(com.google.cloud.automl.v1beta1.DocumentInputConfig value) { + if (inputConfigBuilder_ == null) { + if (inputConfig_ != null) { + inputConfig_ = + com.google.cloud.automl.v1beta1.DocumentInputConfig.newBuilder(inputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + inputConfig_ = value; + } + onChanged(); + } else { + inputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public Builder clearInputConfig() { + if (inputConfigBuilder_ == null) { + inputConfig_ = null; + onChanged(); + } else { + inputConfig_ = null; + inputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder getInputConfigBuilder() { + + onChanged(); + return getInputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { + if (inputConfigBuilder_ != null) { + return inputConfigBuilder_.getMessageOrBuilder(); + } else { + return inputConfig_ == null + ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() + : inputConfig_; + } + } + /** + * + * + *
+     * An input config specifying the content of the document.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.DocumentInputConfig, + com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder> + getInputConfigFieldBuilder() { + if (inputConfigBuilder_ == null) { + inputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.DocumentInputConfig, + com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, + com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder>( + getInputConfig(), getParentForChildren(), isClean()); + inputConfig_ = null; + } + return inputConfigBuilder_; + } + + private com.google.cloud.automl.v1beta1.TextSnippet documentText_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, + com.google.cloud.automl.v1beta1.TextSnippet.Builder, + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> + documentTextBuilder_; + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public boolean hasDocumentText() { + return documentTextBuilder_ != null || documentText_ != null; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet getDocumentText() { + if (documentTextBuilder_ == null) { + return documentText_ == null + ? com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() + : documentText_; + } else { + return documentTextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public Builder setDocumentText(com.google.cloud.automl.v1beta1.TextSnippet value) { + if (documentTextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + documentText_ = value; + onChanged(); + } else { + documentTextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public Builder setDocumentText( + com.google.cloud.automl.v1beta1.TextSnippet.Builder builderForValue) { + if (documentTextBuilder_ == null) { + documentText_ = builderForValue.build(); + onChanged(); + } else { + documentTextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public Builder mergeDocumentText(com.google.cloud.automl.v1beta1.TextSnippet value) { + if (documentTextBuilder_ == null) { + if (documentText_ != null) { + documentText_ = + com.google.cloud.automl.v1beta1.TextSnippet.newBuilder(documentText_) + .mergeFrom(value) + .buildPartial(); + } else { + documentText_ = value; + } + onChanged(); + } else { + documentTextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public Builder clearDocumentText() { + if (documentTextBuilder_ == null) { + documentText_ = null; + onChanged(); + } else { + documentText_ = null; + documentTextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippet.Builder getDocumentTextBuilder() { + + onChanged(); + return getDocumentTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + public com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getDocumentTextOrBuilder() { + if (documentTextBuilder_ != null) { + return documentTextBuilder_.getMessageOrBuilder(); + } else { + return documentText_ == null + ? com.google.cloud.automl.v1beta1.TextSnippet.getDefaultInstance() + : documentText_; + } + } + /** + * + * + *
+     * The plain text version of this document.
+     * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, + com.google.cloud.automl.v1beta1.TextSnippet.Builder, + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder> + getDocumentTextFieldBuilder() { + if (documentTextBuilder_ == null) { + documentTextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.TextSnippet, + com.google.cloud.automl.v1beta1.TextSnippet.Builder, + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder>( + getDocumentText(), getParentForChildren(), isClean()); + documentText_ = null; + } + return documentTextBuilder_; + } + + private java.util.List layout_ = + java.util.Collections.emptyList(); + + private void ensureLayoutIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + layout_ = new java.util.ArrayList(layout_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Document.Layout, + com.google.cloud.automl.v1beta1.Document.Layout.Builder, + com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder> + layoutBuilder_; + + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public java.util.List getLayoutList() { + if (layoutBuilder_ == null) { + return java.util.Collections.unmodifiableList(layout_); + } else { + return layoutBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public int getLayoutCount() { + if (layoutBuilder_ == null) { + return layout_.size(); + } else { + return layoutBuilder_.getCount(); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.Layout getLayout(int index) { + if (layoutBuilder_ == null) { + return layout_.get(index); + } else { + return layoutBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder setLayout(int index, com.google.cloud.automl.v1beta1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.set(index, value); + onChanged(); + } else { + layoutBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder setLayout( + int index, com.google.cloud.automl.v1beta1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.set(index, builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder addLayout(com.google.cloud.automl.v1beta1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.add(value); + onChanged(); + } else { + layoutBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder addLayout(int index, com.google.cloud.automl.v1beta1.Document.Layout value) { + if (layoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayoutIsMutable(); + layout_.add(index, value); + onChanged(); + } else { + layoutBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder addLayout( + com.google.cloud.automl.v1beta1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.add(builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder addLayout( + int index, com.google.cloud.automl.v1beta1.Document.Layout.Builder builderForValue) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.add(index, builderForValue.build()); + onChanged(); + } else { + layoutBuilder_.addMessage(index, builderForValue.build()); } - return result; + return this; } - - @java.lang.Override - public com.google.cloud.automl.v1beta1.Document buildPartial() { - com.google.cloud.automl.v1beta1.Document result = - new com.google.cloud.automl.v1beta1.Document(this); - if (inputConfigBuilder_ == null) { - result.inputConfig_ = inputConfig_; + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder addAllLayout( + java.lang.Iterable values) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, layout_); + onChanged(); } else { - result.inputConfig_ = inputConfigBuilder_.build(); + layoutBuilder_.addAllMessages(values); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + return this; } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder clearLayout() { + if (layoutBuilder_ == null) { + layout_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + layoutBuilder_.clear(); + } + return this; } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public Builder removeLayout(int index) { + if (layoutBuilder_ == null) { + ensureLayoutIsMutable(); + layout_.remove(index); + onChanged(); + } else { + layoutBuilder_.remove(index); + } + return this; } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.Layout.Builder getLayoutBuilder(int index) { + return getLayoutFieldBuilder().getBuilder(index); } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.automl.v1beta1.Document) { - return mergeFrom((com.google.cloud.automl.v1beta1.Document) other); + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder getLayoutOrBuilder(int index) { + if (layoutBuilder_ == null) { + return layout_.get(index); } else { - super.mergeFrom(other); - return this; + return layoutBuilder_.getMessageOrBuilder(index); } } - - public Builder mergeFrom(com.google.cloud.automl.v1beta1.Document other) { - if (other == com.google.cloud.automl.v1beta1.Document.getDefaultInstance()) return this; - if (other.hasInputConfig()) { - mergeInputConfig(other.getInputConfig()); + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutOrBuilderList() { + if (layoutBuilder_ != null) { + return layoutBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(layout_); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.Layout.Builder addLayoutBuilder() { + return getLayoutFieldBuilder() + .addBuilder(com.google.cloud.automl.v1beta1.Document.Layout.getDefaultInstance()); + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public com.google.cloud.automl.v1beta1.Document.Layout.Builder addLayoutBuilder(int index) { + return getLayoutFieldBuilder() + .addBuilder(index, com.google.cloud.automl.v1beta1.Document.Layout.getDefaultInstance()); + } + /** + * + * + *
+     * Describes the layout of the document.
+     * Sorted by [page_number][].
+     * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + public java.util.List + getLayoutBuilderList() { + return getLayoutFieldBuilder().getBuilderList(); } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.automl.v1beta1.Document parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.automl.v1beta1.Document) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Document.Layout, + com.google.cloud.automl.v1beta1.Document.Layout.Builder, + com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder> + getLayoutFieldBuilder() { + if (layoutBuilder_ == null) { + layoutBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.automl.v1beta1.Document.Layout, + com.google.cloud.automl.v1beta1.Document.Layout.Builder, + com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder>( + layout_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + layout_ = null; } - return this; + return layoutBuilder_; } - private com.google.cloud.automl.v1beta1.DocumentInputConfig inputConfig_; + private com.google.cloud.automl.v1beta1.DocumentDimensions documentDimensions_; private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1beta1.DocumentInputConfig, - com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, - com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder> - inputConfigBuilder_; + com.google.cloud.automl.v1beta1.DocumentDimensions, + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder, + com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder> + documentDimensionsBuilder_; /** * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public boolean hasInputConfig() { - return inputConfigBuilder_ != null || inputConfig_ != null; + public boolean hasDocumentDimensions() { + return documentDimensionsBuilder_ != null || documentDimensions_ != null; } /** * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public com.google.cloud.automl.v1beta1.DocumentInputConfig getInputConfig() { - if (inputConfigBuilder_ == null) { - return inputConfig_ == null - ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() - : inputConfig_; + public com.google.cloud.automl.v1beta1.DocumentDimensions getDocumentDimensions() { + if (documentDimensionsBuilder_ == null) { + return documentDimensions_ == null + ? com.google.cloud.automl.v1beta1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; } else { - return inputConfigBuilder_.getMessage(); + return documentDimensionsBuilder_.getMessage(); } } /** * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public Builder setInputConfig(com.google.cloud.automl.v1beta1.DocumentInputConfig value) { - if (inputConfigBuilder_ == null) { + public Builder setDocumentDimensions(com.google.cloud.automl.v1beta1.DocumentDimensions value) { + if (documentDimensionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - inputConfig_ = value; + documentDimensions_ = value; onChanged(); } else { - inputConfigBuilder_.setMessage(value); + documentDimensionsBuilder_.setMessage(value); } return this; @@ -529,18 +3406,18 @@ public Builder setInputConfig(com.google.cloud.automl.v1beta1.DocumentInputConfi * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public Builder setInputConfig( - com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder builderForValue) { - if (inputConfigBuilder_ == null) { - inputConfig_ = builderForValue.build(); + public Builder setDocumentDimensions( + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder builderForValue) { + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = builderForValue.build(); onChanged(); } else { - inputConfigBuilder_.setMessage(builderForValue.build()); + documentDimensionsBuilder_.setMessage(builderForValue.build()); } return this; @@ -549,24 +3426,25 @@ public Builder setInputConfig( * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public Builder mergeInputConfig(com.google.cloud.automl.v1beta1.DocumentInputConfig value) { - if (inputConfigBuilder_ == null) { - if (inputConfig_ != null) { - inputConfig_ = - com.google.cloud.automl.v1beta1.DocumentInputConfig.newBuilder(inputConfig_) + public Builder mergeDocumentDimensions( + com.google.cloud.automl.v1beta1.DocumentDimensions value) { + if (documentDimensionsBuilder_ == null) { + if (documentDimensions_ != null) { + documentDimensions_ = + com.google.cloud.automl.v1beta1.DocumentDimensions.newBuilder(documentDimensions_) .mergeFrom(value) .buildPartial(); } else { - inputConfig_ = value; + documentDimensions_ = value; } onChanged(); } else { - inputConfigBuilder_.mergeFrom(value); + documentDimensionsBuilder_.mergeFrom(value); } return this; @@ -575,18 +3453,18 @@ public Builder mergeInputConfig(com.google.cloud.automl.v1beta1.DocumentInputCon * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public Builder clearInputConfig() { - if (inputConfigBuilder_ == null) { - inputConfig_ = null; + public Builder clearDocumentDimensions() { + if (documentDimensionsBuilder_ == null) { + documentDimensions_ = null; onChanged(); } else { - inputConfig_ = null; - inputConfigBuilder_ = null; + documentDimensions_ = null; + documentDimensionsBuilder_ = null; } return this; @@ -595,58 +3473,104 @@ public Builder clearInputConfig() { * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder getInputConfigBuilder() { + public com.google.cloud.automl.v1beta1.DocumentDimensions.Builder + getDocumentDimensionsBuilder() { onChanged(); - return getInputConfigFieldBuilder().getBuilder(); + return getDocumentDimensionsFieldBuilder().getBuilder(); } /** * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ - public com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder getInputConfigOrBuilder() { - if (inputConfigBuilder_ != null) { - return inputConfigBuilder_.getMessageOrBuilder(); + public com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder + getDocumentDimensionsOrBuilder() { + if (documentDimensionsBuilder_ != null) { + return documentDimensionsBuilder_.getMessageOrBuilder(); } else { - return inputConfig_ == null - ? com.google.cloud.automl.v1beta1.DocumentInputConfig.getDefaultInstance() - : inputConfig_; + return documentDimensions_ == null + ? com.google.cloud.automl.v1beta1.DocumentDimensions.getDefaultInstance() + : documentDimensions_; } } /** * * *
-     * An input config specifying the content of the document.
+     * The dimensions of the page in the document.
      * 
* - * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1beta1.DocumentInputConfig, - com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, - com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder> - getInputConfigFieldBuilder() { - if (inputConfigBuilder_ == null) { - inputConfigBuilder_ = + com.google.cloud.automl.v1beta1.DocumentDimensions, + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder, + com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder> + getDocumentDimensionsFieldBuilder() { + if (documentDimensionsBuilder_ == null) { + documentDimensionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.automl.v1beta1.DocumentInputConfig, - com.google.cloud.automl.v1beta1.DocumentInputConfig.Builder, - com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder>( - getInputConfig(), getParentForChildren(), isClean()); - inputConfig_ = null; + com.google.cloud.automl.v1beta1.DocumentDimensions, + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder, + com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder>( + getDocumentDimensions(), getParentForChildren(), isClean()); + documentDimensions_ = null; } - return inputConfigBuilder_; + return documentDimensionsBuilder_; + } + + private int pageCount_; + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public int getPageCount() { + return pageCount_; + } + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public Builder setPageCount(int value) { + + pageCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of pages in the document.
+     * 
+ * + * int32 page_count = 5; + */ + public Builder clearPageCount() { + + pageCount_ = 0; + onChanged(); + return this; } @java.lang.Override diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensions.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensions.java new file mode 100644 index 000000000000..64ffb652d998 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensions.java @@ -0,0 +1,909 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +/** + * + * + *
+ * Message that describes dimension of a document.
+ * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DocumentDimensions} + */ +public final class DocumentDimensions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.DocumentDimensions) + DocumentDimensionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentDimensions.newBuilder() to construct. + private DocumentDimensions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentDimensions() { + unit_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DocumentDimensions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + unit_ = rawValue; + break; + } + case 21: + { + width_ = input.readFloat(); + break; + } + case 29: + { + height_ = input.readFloat(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_DocumentDimensions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DocumentDimensions.class, + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder.class); + } + + /** + * + * + *
+   * Unit of the document dimension.
+   * 
+ * + * Protobuf enum {@code google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit} + */ + public enum DocumentDimensionUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Should not be used.
+     * 
+ * + * DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED(0), + /** + * + * + *
+     * Document dimension is measured in inches.
+     * 
+ * + * INCH = 1; + */ + INCH(1), + /** + * + * + *
+     * Document dimension is measured in centimeters.
+     * 
+ * + * CENTIMETER = 2; + */ + CENTIMETER(2), + /** + * + * + *
+     * Document dimension is measured in points. 72 points = 1 inch.
+     * 
+ * + * POINT = 3; + */ + POINT(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Should not be used.
+     * 
+ * + * DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + public static final int DOCUMENT_DIMENSION_UNIT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Document dimension is measured in inches.
+     * 
+ * + * INCH = 1; + */ + public static final int INCH_VALUE = 1; + /** + * + * + *
+     * Document dimension is measured in centimeters.
+     * 
+ * + * CENTIMETER = 2; + */ + public static final int CENTIMETER_VALUE = 2; + /** + * + * + *
+     * Document dimension is measured in points. 72 points = 1 inch.
+     * 
+ * + * POINT = 3; + */ + public static final int POINT_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static DocumentDimensionUnit valueOf(int value) { + return forNumber(value); + } + + public static DocumentDimensionUnit forNumber(int value) { + switch (value) { + case 0: + return DOCUMENT_DIMENSION_UNIT_UNSPECIFIED; + case 1: + return INCH; + case 2: + return CENTIMETER; + case 3: + return POINT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DocumentDimensionUnit findValueByNumber(int number) { + return DocumentDimensionUnit.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DocumentDimensions.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DocumentDimensionUnit[] VALUES = values(); + + public static DocumentDimensionUnit valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DocumentDimensionUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit) + } + + public static final int UNIT_FIELD_NUMBER = 1; + private int unit_; + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit getUnit() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit result = + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit.valueOf(unit_); + return result == null + ? com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit.UNRECOGNIZED + : result; + } + + public static final int WIDTH_FIELD_NUMBER = 2; + private float width_; + /** + * + * + *
+   * Width value of the document, works together with the unit.
+   * 
+ * + * float width = 2; + */ + public float getWidth() { + return width_; + } + + public static final int HEIGHT_FIELD_NUMBER = 3; + private float height_; + /** + * + * + *
+   * Height value of the document, works together with the unit.
+   * 
+ * + * float height = 3; + */ + public float getHeight() { + return height_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (unit_ + != com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit + .DOCUMENT_DIMENSION_UNIT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, unit_); + } + if (width_ != 0F) { + output.writeFloat(2, width_); + } + if (height_ != 0F) { + output.writeFloat(3, height_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unit_ + != com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit + .DOCUMENT_DIMENSION_UNIT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, unit_); + } + if (width_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, width_); + } + if (height_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, height_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.automl.v1beta1.DocumentDimensions)) { + return super.equals(obj); + } + com.google.cloud.automl.v1beta1.DocumentDimensions other = + (com.google.cloud.automl.v1beta1.DocumentDimensions) obj; + + if (unit_ != other.unit_) return false; + if (java.lang.Float.floatToIntBits(getWidth()) + != java.lang.Float.floatToIntBits(other.getWidth())) return false; + if (java.lang.Float.floatToIntBits(getHeight()) + != java.lang.Float.floatToIntBits(other.getHeight())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + unit_; + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getWidth()); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getHeight()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.automl.v1beta1.DocumentDimensions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message that describes dimension of a document.
+   * 
+ * + * Protobuf type {@code google.cloud.automl.v1beta1.DocumentDimensions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.DocumentDimensions) + com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_DocumentDimensions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.automl.v1beta1.DocumentDimensions.class, + com.google.cloud.automl.v1beta1.DocumentDimensions.Builder.class); + } + + // Construct using com.google.cloud.automl.v1beta1.DocumentDimensions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + unit_ = 0; + + width_ = 0F; + + height_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.automl.v1beta1.DataItems + .internal_static_google_cloud_automl_v1beta1_DocumentDimensions_descriptor; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.DocumentDimensions getDefaultInstanceForType() { + return com.google.cloud.automl.v1beta1.DocumentDimensions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.DocumentDimensions build() { + com.google.cloud.automl.v1beta1.DocumentDimensions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.DocumentDimensions buildPartial() { + com.google.cloud.automl.v1beta1.DocumentDimensions result = + new com.google.cloud.automl.v1beta1.DocumentDimensions(this); + result.unit_ = unit_; + result.width_ = width_; + result.height_ = height_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.automl.v1beta1.DocumentDimensions) { + return mergeFrom((com.google.cloud.automl.v1beta1.DocumentDimensions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.automl.v1beta1.DocumentDimensions other) { + if (other == com.google.cloud.automl.v1beta1.DocumentDimensions.getDefaultInstance()) + return this; + if (other.unit_ != 0) { + setUnitValue(other.getUnitValue()); + } + if (other.getWidth() != 0F) { + setWidth(other.getWidth()); + } + if (other.getHeight() != 0F) { + setHeight(other.getHeight()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.automl.v1beta1.DocumentDimensions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.automl.v1beta1.DocumentDimensions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int unit_ = 0; + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder setUnitValue(int value) { + unit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit getUnit() { + @SuppressWarnings("deprecation") + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit result = + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit.valueOf(unit_); + return result == null + ? com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder setUnit( + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Unit of the dimension.
+     * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + public Builder clearUnit() { + + unit_ = 0; + onChanged(); + return this; + } + + private float width_; + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public float getWidth() { + return width_; + } + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public Builder setWidth(float value) { + + width_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Width value of the document, works together with the unit.
+     * 
+ * + * float width = 2; + */ + public Builder clearWidth() { + + width_ = 0F; + onChanged(); + return this; + } + + private float height_; + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public float getHeight() { + return height_; + } + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public Builder setHeight(float value) { + + height_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Height value of the document, works together with the unit.
+     * 
+ * + * float height = 3; + */ + public Builder clearHeight() { + + height_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.DocumentDimensions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DocumentDimensions) + private static final com.google.cloud.automl.v1beta1.DocumentDimensions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.DocumentDimensions(); + } + + public static com.google.cloud.automl.v1beta1.DocumentDimensions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentDimensions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DocumentDimensions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.automl.v1beta1.DocumentDimensions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensionsOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensionsOrBuilder.java new file mode 100644 index 000000000000..81cc740d1fb6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentDimensionsOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/automl/v1beta1/data_items.proto + +package com.google.cloud.automl.v1beta1; + +public interface DocumentDimensionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.DocumentDimensions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + int getUnitValue(); + /** + * + * + *
+   * Unit of the dimension.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + com.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit getUnit(); + + /** + * + * + *
+   * Width value of the document, works together with the unit.
+   * 
+ * + * float width = 2; + */ + float getWidth(); + + /** + * + * + *
+   * Height value of the document, works together with the unit.
+   * 
+ * + * float height = 3; + */ + float getHeight(); +} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentOrBuilder.java index 59e37ecbd277..a11d5a2bb7a5 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/DocumentOrBuilder.java @@ -38,4 +38,134 @@ public interface DocumentOrBuilder * .google.cloud.automl.v1beta1.DocumentInputConfig input_config = 1; */ com.google.cloud.automl.v1beta1.DocumentInputConfigOrBuilder getInputConfigOrBuilder(); + + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + boolean hasDocumentText(); + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + com.google.cloud.automl.v1beta1.TextSnippet getDocumentText(); + /** + * + * + *
+   * The plain text version of this document.
+   * 
+ * + * .google.cloud.automl.v1beta1.TextSnippet document_text = 2; + */ + com.google.cloud.automl.v1beta1.TextSnippetOrBuilder getDocumentTextOrBuilder(); + + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + java.util.List getLayoutList(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + com.google.cloud.automl.v1beta1.Document.Layout getLayout(int index); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + int getLayoutCount(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + java.util.List + getLayoutOrBuilderList(); + /** + * + * + *
+   * Describes the layout of the document.
+   * Sorted by [page_number][].
+   * 
+ * + * repeated .google.cloud.automl.v1beta1.Document.Layout layout = 3; + */ + com.google.cloud.automl.v1beta1.Document.LayoutOrBuilder getLayoutOrBuilder(int index); + + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + boolean hasDocumentDimensions(); + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + com.google.cloud.automl.v1beta1.DocumentDimensions getDocumentDimensions(); + /** + * + * + *
+   * The dimensions of the page in the document.
+   * 
+ * + * .google.cloud.automl.v1beta1.DocumentDimensions document_dimensions = 4; + */ + com.google.cloud.automl.v1beta1.DocumentDimensionsOrBuilder getDocumentDimensionsOrBuilder(); + + /** + * + * + *
+   * Number of pages in the document.
+   * 
+ * + * int32 page_count = 5; + */ + int getPageCount(); } diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java index 8616ea0f3e9b..388c873bda34 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/InputConfig.java @@ -116,7 +116,8 @@ * CSV file(s) with each line in format: * ML_USE,GCS_FILE_PATH * GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which - * either imports text in-line or as documents. + * either imports text in-line or as documents. Any given + * .JSONL file must be 100MB or smaller. * The in-line .JSONL file contains, per line, a proto that wraps a * TextSnippet proto (in json representation) followed by one or more * AnnotationPayload protos (called annotations), which have @@ -124,12 +125,16 @@ * is expected to be annotated exhaustively, for example, if you look * for animals and text contains "dolphin" that is not labeled, then * "dolphin" is assumed to not be an animal. Any given text snippet - * content must have 30,000 characters or less, and also be UTF-8 NFC - * encoded (ASCII already is). The document .JSONL file contains, per line, a proto that wraps a - * Document proto with input_config set. Only PDF documents are - * supported now, and each document may be up to 2MB large. Currently - * annotations on documents cannot be specified at import. Any given - * .JSONL file must be 100MB or smaller. + * content must be 10KB or smaller, and also be UTF-8 NFC encoded + * (ASCII already is). + * The document .JSONL file contains, per line, a proto that wraps a + * Document proto. The Document proto must have either document_text + * or input_config set. In document_text case, the Document proto may + * also contain the spatial information of the document, including + * layout, document dimension and page number. In input_config case, + * only PDF documents are supported now, and each document may be up + * to 2MB large. Currently, annotations on documents cannot be + * specified at import. * Three sample CSV rows: * TRAIN,gs://folder/file1.jsonl * VALIDATE,gs://folder/file2.jsonl @@ -138,27 +143,60 @@ * with artificial line breaks, but the only actual line break is * denoted by \n).: * { - * "text_snippet": { - * "content": "dog car cat" - * } "annotations": [ - * { - * "display_name": "animal", - * "text_extraction": { - * "text_segment": {"start_offset": 0, "end_offset": 3} + * "document": { + * "document_text": {"content": "dog cat"} + * "layout": [ + * { + * "text_segment": { + * "start_offset": 0, + * "end_offset": 3, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, + * }, + * { + * "text_segment": { + * "start_offset": 4, + * "end_offset": 7, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.4, "y": 0.1}, + * {"x": 0.4, "y": 0.3}, + * {"x": 0.8, "y": 0.3}, + * {"x": 0.8, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, * } - * }, + * ], + * "document_dimensions": { + * "width": 8.27, + * "height": 11.69, + * "unit": INCH, + * } + * "page_count": 1, + * }, + * "annotations": [ * { - * "display_name": "vehicle", - * "text_extraction": { - * "text_segment": {"start_offset": 4, "end_offset": 7} - * } + * "display_name": "animal", + * "text_extraction": {"text_segment": {"start_offset": 0, + * "end_offset": 3}} * }, * { * "display_name": "animal", - * "text_extraction": { - * "text_segment": {"start_offset": 8, "end_offset": 11} - * } - * }, + * "text_extraction": {"text_segment": {"start_offset": 4, + * "end_offset": 7}} + * } * ], * }\n * { @@ -1016,7 +1054,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * CSV file(s) with each line in format: * ML_USE,GCS_FILE_PATH * GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which - * either imports text in-line or as documents. + * either imports text in-line or as documents. Any given + * .JSONL file must be 100MB or smaller. * The in-line .JSONL file contains, per line, a proto that wraps a * TextSnippet proto (in json representation) followed by one or more * AnnotationPayload protos (called annotations), which have @@ -1024,12 +1063,16 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * is expected to be annotated exhaustively, for example, if you look * for animals and text contains "dolphin" that is not labeled, then * "dolphin" is assumed to not be an animal. Any given text snippet - * content must have 30,000 characters or less, and also be UTF-8 NFC - * encoded (ASCII already is). The document .JSONL file contains, per line, a proto that wraps a - * Document proto with input_config set. Only PDF documents are - * supported now, and each document may be up to 2MB large. Currently - * annotations on documents cannot be specified at import. Any given - * .JSONL file must be 100MB or smaller. + * content must be 10KB or smaller, and also be UTF-8 NFC encoded + * (ASCII already is). + * The document .JSONL file contains, per line, a proto that wraps a + * Document proto. The Document proto must have either document_text + * or input_config set. In document_text case, the Document proto may + * also contain the spatial information of the document, including + * layout, document dimension and page number. In input_config case, + * only PDF documents are supported now, and each document may be up + * to 2MB large. Currently, annotations on documents cannot be + * specified at import. * Three sample CSV rows: * TRAIN,gs://folder/file1.jsonl * VALIDATE,gs://folder/file2.jsonl @@ -1038,27 +1081,60 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * with artificial line breaks, but the only actual line break is * denoted by \n).: * { - * "text_snippet": { - * "content": "dog car cat" - * } "annotations": [ - * { - * "display_name": "animal", - * "text_extraction": { - * "text_segment": {"start_offset": 0, "end_offset": 3} + * "document": { + * "document_text": {"content": "dog cat"} + * "layout": [ + * { + * "text_segment": { + * "start_offset": 0, + * "end_offset": 3, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, + * }, + * { + * "text_segment": { + * "start_offset": 4, + * "end_offset": 7, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.4, "y": 0.1}, + * {"x": 0.4, "y": 0.3}, + * {"x": 0.8, "y": 0.3}, + * {"x": 0.8, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, * } - * }, + * ], + * "document_dimensions": { + * "width": 8.27, + * "height": 11.69, + * "unit": INCH, + * } + * "page_count": 1, + * }, + * "annotations": [ * { - * "display_name": "vehicle", - * "text_extraction": { - * "text_segment": {"start_offset": 4, "end_offset": 7} - * } + * "display_name": "animal", + * "text_extraction": {"text_segment": {"start_offset": 0, + * "end_offset": 3}} * }, * { * "display_name": "animal", - * "text_extraction": { - * "text_segment": {"start_offset": 8, "end_offset": 11} - * } - * }, + * "text_extraction": {"text_segment": {"start_offset": 4, + * "end_offset": 7}} + * } * ], * }\n * { diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java index dab002751cf8..03084085807f 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictRequest.java @@ -7,7 +7,8 @@ * * *
- * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+ * Request message for
+ * [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
  * 
* * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest} @@ -578,7 +579,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+   * Request message for
+   * [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
    * 
* * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest} diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java index 5842f1401db2..e6e3c0574d91 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponse.java @@ -7,7 +7,8 @@ * * *
- * Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+ * Response message for
+ * [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
  * 
* * Protobuf type {@code google.cloud.automl.v1beta1.PredictResponse} @@ -65,17 +66,33 @@ private PredictResponse( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { metadata_ = com.google.protobuf.MapField.newMapField( MetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000004; } com.google.protobuf.MapEntry metadata__ = input.readMessage( MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 26: + { + com.google.cloud.automl.v1beta1.ExamplePayload.Builder subBuilder = null; + if (preprocessedInput_ != null) { + subBuilder = preprocessedInput_.toBuilder(); + } + preprocessedInput_ = + input.readMessage( + com.google.cloud.automl.v1beta1.ExamplePayload.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(preprocessedInput_); + preprocessedInput_ = subBuilder.buildPartial(); + } + break; } default: @@ -126,6 +143,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.automl.v1beta1.PredictResponse.Builder.class); } + private int bitField0_; public static final int PAYLOAD_FIELD_NUMBER = 1; private java.util.List payload_; /** @@ -195,6 +213,59 @@ public com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder getPayloadOrBu return payload_.get(index); } + public static final int PREPROCESSED_INPUT_FIELD_NUMBER = 3; + private com.google.cloud.automl.v1beta1.ExamplePayload preprocessedInput_; + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public boolean hasPreprocessedInput() { + return preprocessedInput_ != null; + } + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1beta1.ExamplePayload getPreprocessedInput() { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() { + return getPreprocessedInput(); + } + public static final int METADATA_FIELD_NUMBER = 2; private static final class MetadataDefaultEntryHolder { @@ -356,6 +427,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + if (preprocessedInput_ != null) { + output.writeMessage(3, getPreprocessedInput()); + } unknownFields.writeTo(output); } @@ -378,6 +452,9 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__); } + if (preprocessedInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPreprocessedInput()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -395,6 +472,10 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.automl.v1beta1.PredictResponse) obj; if (!getPayloadList().equals(other.getPayloadList())) return false; + if (hasPreprocessedInput() != other.hasPreprocessedInput()) return false; + if (hasPreprocessedInput()) { + if (!getPreprocessedInput().equals(other.getPreprocessedInput())) return false; + } if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -411,6 +492,10 @@ public int hashCode() { hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayloadList().hashCode(); } + if (hasPreprocessedInput()) { + hash = (37 * hash) + PREPROCESSED_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getPreprocessedInput().hashCode(); + } if (!internalGetMetadata().getMap().isEmpty()) { hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + internalGetMetadata().hashCode(); @@ -519,7 +604,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
+   * Response message for
+   * [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
    * 
* * Protobuf type {@code google.cloud.automl.v1beta1.PredictResponse} @@ -588,6 +674,12 @@ public Builder clear() { } else { payloadBuilder_.clear(); } + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = null; + } else { + preprocessedInput_ = null; + preprocessedInputBuilder_ = null; + } internalGetMutableMetadata().clear(); return this; } @@ -617,6 +709,7 @@ public com.google.cloud.automl.v1beta1.PredictResponse buildPartial() { com.google.cloud.automl.v1beta1.PredictResponse result = new com.google.cloud.automl.v1beta1.PredictResponse(this); int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (payloadBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { payload_ = java.util.Collections.unmodifiableList(payload_); @@ -626,8 +719,14 @@ public com.google.cloud.automl.v1beta1.PredictResponse buildPartial() { } else { result.payload_ = payloadBuilder_.build(); } + if (preprocessedInputBuilder_ == null) { + result.preprocessedInput_ = preprocessedInput_; + } else { + result.preprocessedInput_ = preprocessedInputBuilder_.build(); + } result.metadata_ = internalGetMetadata(); result.metadata_.makeImmutable(); + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -705,6 +804,9 @@ public Builder mergeFrom(com.google.cloud.automl.v1beta1.PredictResponse other) } } } + if (other.hasPreprocessedInput()) { + mergePreprocessedInput(other.getPreprocessedInput()); + } internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -1108,6 +1210,224 @@ public com.google.cloud.automl.v1beta1.AnnotationPayload.Builder addPayloadBuild return payloadBuilder_; } + private com.google.cloud.automl.v1beta1.ExamplePayload preprocessedInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, + com.google.cloud.automl.v1beta1.ExamplePayload.Builder, + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder> + preprocessedInputBuilder_; + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public boolean hasPreprocessedInput() { + return preprocessedInputBuilder_ != null || preprocessedInput_ != null; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1beta1.ExamplePayload getPreprocessedInput() { + if (preprocessedInputBuilder_ == null) { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } else { + return preprocessedInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public Builder setPreprocessedInput(com.google.cloud.automl.v1beta1.ExamplePayload value) { + if (preprocessedInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preprocessedInput_ = value; + onChanged(); + } else { + preprocessedInputBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public Builder setPreprocessedInput( + com.google.cloud.automl.v1beta1.ExamplePayload.Builder builderForValue) { + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = builderForValue.build(); + onChanged(); + } else { + preprocessedInputBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public Builder mergePreprocessedInput(com.google.cloud.automl.v1beta1.ExamplePayload value) { + if (preprocessedInputBuilder_ == null) { + if (preprocessedInput_ != null) { + preprocessedInput_ = + com.google.cloud.automl.v1beta1.ExamplePayload.newBuilder(preprocessedInput_) + .mergeFrom(value) + .buildPartial(); + } else { + preprocessedInput_ = value; + } + onChanged(); + } else { + preprocessedInputBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public Builder clearPreprocessedInput() { + if (preprocessedInputBuilder_ == null) { + preprocessedInput_ = null; + onChanged(); + } else { + preprocessedInput_ = null; + preprocessedInputBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1beta1.ExamplePayload.Builder getPreprocessedInputBuilder() { + + onChanged(); + return getPreprocessedInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder() { + if (preprocessedInputBuilder_ != null) { + return preprocessedInputBuilder_.getMessageOrBuilder(); + } else { + return preprocessedInput_ == null + ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance() + : preprocessedInput_; + } + } + /** + * + * + *
+     * The preprocessed example that AutoML actually makes prediction on.
+     * Empty if AutoML does not preprocess the input example.
+     * * For Text Extraction:
+     *   If the input is a .pdf file, the OCR'ed text will be provided in
+     *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+     * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, + com.google.cloud.automl.v1beta1.ExamplePayload.Builder, + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder> + getPreprocessedInputFieldBuilder() { + if (preprocessedInputBuilder_ == null) { + preprocessedInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.automl.v1beta1.ExamplePayload, + com.google.cloud.automl.v1beta1.ExamplePayload.Builder, + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder>( + getPreprocessedInput(), getParentForChildren(), isClean()); + preprocessedInput_ = null; + } + return preprocessedInputBuilder_; + } + private com.google.protobuf.MapField metadata_; private com.google.protobuf.MapField internalGetMetadata() { diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java index 5e616f7133f1..517c501d104e 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictResponseOrBuilder.java @@ -65,6 +65,49 @@ public interface PredictResponseOrBuilder */ com.google.cloud.automl.v1beta1.AnnotationPayloadOrBuilder getPayloadOrBuilder(int index); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + boolean hasPreprocessedInput(); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + com.google.cloud.automl.v1beta1.ExamplePayload getPreprocessedInput(); + /** + * + * + *
+   * The preprocessed example that AutoML actually makes prediction on.
+   * Empty if AutoML does not preprocess the input example.
+   * * For Text Extraction:
+   *   If the input is a .pdf file, the OCR'ed text will be provided in
+   *   [document_text][google.cloud.automl.v1beta1.Document.document_text].
+   * 
+ * + * .google.cloud.automl.v1beta1.ExamplePayload preprocessed_input = 3; + */ + com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPreprocessedInputOrBuilder(); + /** * * diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java index 3629e484b030..9094cd586b1a 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/PredictionServiceProto.java @@ -55,52 +55,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n4google/cloud/automl/v1beta1/prediction" + "_service.proto\022\033google.cloud.automl.v1be" - + "ta1\032\034google/api/annotations.proto\0324googl" - + "e/cloud/automl/v1beta1/annotation_payloa" - + "d.proto\032,google/cloud/automl/v1beta1/dat" - + "a_items.proto\032$google/cloud/automl/v1bet" - + "a1/io.proto\032,google/cloud/automl/v1beta1" - + "/operations.proto\032#google/longrunning/op" - + "erations.proto\032\027google/api/client.proto\"" + + "ta1\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\0324google/cloud/automl/" + + "v1beta1/annotation_payload.proto\032,google" + + "/cloud/automl/v1beta1/data_items.proto\032$" + + "google/cloud/automl/v1beta1/io.proto\032,go" + + "ogle/cloud/automl/v1beta1/operations.pro" + + "to\032#google/longrunning/operations.proto\"" + "\324\001\n\016PredictRequest\022\014\n\004name\030\001 \001(\t\022<\n\007payl" + "oad\030\002 \001(\0132+.google.cloud.automl.v1beta1." + "ExamplePayload\022G\n\006params\030\003 \003(\01327.google." + "cloud.automl.v1beta1.PredictRequest.Para" + "msEntry\032-\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - + "alue\030\002 \001(\t:\0028\001\"\321\001\n\017PredictResponse\022?\n\007pa" + + "alue\030\002 \001(\t:\0028\001\"\232\002\n\017PredictResponse\022?\n\007pa" + "yload\030\001 \003(\0132..google.cloud.automl.v1beta" - + "1.AnnotationPayload\022L\n\010metadata\030\002 \003(\0132:." - + "google.cloud.automl.v1beta1.PredictRespo" - + "nse.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003ke" - + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\272\002\n\023BatchPred" - + "ictRequest\022\014\n\004name\030\001 \001(\t\022J\n\014input_config" - + "\030\003 \001(\01324.google.cloud.automl.v1beta1.Bat" - + "chPredictInputConfig\022L\n\routput_config\030\004 " - + "\001(\01325.google.cloud.automl.v1beta1.BatchP" - + "redictOutputConfig\022L\n\006params\030\005 \003(\0132<.goo" - + "gle.cloud.automl.v1beta1.BatchPredictReq" - + "uest.ParamsEntry\032-\n\013ParamsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\226\001\n\022BatchPredict" - + "Result\022O\n\010metadata\030\001 \003(\0132=.google.cloud." - + "automl.v1beta1.BatchPredictResult.Metada" - + "taEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\0012\264\003\n\021PredictionService\022\250" - + "\001\n\007Predict\022+.google.cloud.automl.v1beta1" - + ".PredictRequest\032,.google.cloud.automl.v1" - + "beta1.PredictResponse\"B\202\323\344\223\002<\"7/v1beta1/" - + "{name=projects/*/locations/*/models/*}:p" - + "redict:\001*\022\250\001\n\014BatchPredict\0220.google.clou" - + "d.automl.v1beta1.BatchPredictRequest\032\035.g" - + "oogle.longrunning.Operation\"G\202\323\344\223\002A\" - * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed - * values are "text/html" and "text/plain". If left blank, the format is - * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content]. + * Optional. The format of + * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the + * only two allowed values are "text/html" and "text/plain". If left blank, + * the format is automatically determined from the type of the uploaded + * [content][google.cloud.automl.v1beta1.TextSnippet.content]. *
* * string mime_type = 2; @@ -180,9 +182,11 @@ public java.lang.String getMimeType() { * * *
-   * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+   * only two allowed values are "text/html" and "text/plain". If left blank,
+   * the format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content].
    * 
* * string mime_type = 2; @@ -694,9 +698,11 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+     * only two allowed values are "text/html" and "text/plain". If left blank,
+     * the format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -716,9 +722,11 @@ public java.lang.String getMimeType() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+     * only two allowed values are "text/html" and "text/plain". If left blank,
+     * the format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -738,9 +746,11 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+     * only two allowed values are "text/html" and "text/plain". If left blank,
+     * the format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -758,9 +768,11 @@ public Builder setMimeType(java.lang.String value) { * * *
-     * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+     * only two allowed values are "text/html" and "text/plain". If left blank,
+     * the format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content].
      * 
* * string mime_type = 2; @@ -775,9 +787,11 @@ public Builder clearMimeType() { * * *
-     * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-     * values are "text/html" and "text/plain". If left blank, the format is
-     * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+     * Optional. The format of
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+     * only two allowed values are "text/html" and "text/plain". If left blank,
+     * the format is automatically determined from the type of the uploaded
+     * [content][google.cloud.automl.v1beta1.TextSnippet.content].
      * 
* * string mime_type = 2; diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java index 1ef5984df35b..786549431755 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/TextSnippetOrBuilder.java @@ -35,9 +35,11 @@ public interface TextSnippetOrBuilder * * *
-   * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+   * only two allowed values are "text/html" and "text/plain". If left blank,
+   * the format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content].
    * 
* * string mime_type = 2; @@ -47,9 +49,11 @@ public interface TextSnippetOrBuilder * * *
-   * Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
-   * values are "text/html" and "text/plain". If left blank, the format is
-   * automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
+   * Optional. The format of
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the
+   * only two allowed values are "text/html" and "text/plain". If left blank,
+   * the format is automatically determined from the type of the uploaded
+   * [content][google.cloud.automl.v1beta1.TextSnippet.content].
    * 
* * string mime_type = 2; diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto index fec75d3bbd73..fdbea7042d84 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/data_items.proto @@ -17,11 +17,13 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; +import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/geometry.proto"; import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/text_segment.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -56,19 +58,135 @@ message TextSnippet { // characters long. string content = 1; - // Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed - // values are "text/html" and "text/plain". If left blank, the format is - // automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content]. + // Optional. The format of + // [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the + // only two allowed values are "text/html" and "text/plain". If left blank, + // the format is automatically determined from the type of the uploaded + // [content][google.cloud.automl.v1beta1.TextSnippet.content]. string mime_type = 2; // Output only. HTTP URI where you can download the content. string content_uri = 4; } +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + // A structured text document e.g. a PDF. message Document { + // Describes the layout information of a + // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in + // the document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the + // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] + // in the original document, starts from 1. + int32 page_number = 2; + + // The position of the + // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] + // in the page. Contains exactly 4 + // + // [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the + // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] + // in document. + TextSegmentType text_segment_type = 4; + } + // An input config specifying the content of the document. DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; } // A representation of a row in a relational table. diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto index c08edc277474..6f007f02a10d 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/io.proto @@ -140,7 +140,8 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // CSV file(s) with each line in format: // ML_USE,GCS_FILE_PATH // GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which -// either imports text in-line or as documents. +// either imports text in-line or as documents. Any given +// .JSONL file must be 100MB or smaller. // The in-line .JSONL file contains, per line, a proto that wraps a // TextSnippet proto (in json representation) followed by one or more // AnnotationPayload protos (called annotations), which have @@ -148,12 +149,16 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // is expected to be annotated exhaustively, for example, if you look // for animals and text contains "dolphin" that is not labeled, then // "dolphin" is assumed to not be an animal. Any given text snippet -// content must have 30,000 characters or less, and also be UTF-8 NFC -// encoded (ASCII already is). The document .JSONL file contains, per line, a proto that wraps a -// Document proto with input_config set. Only PDF documents are -// supported now, and each document may be up to 2MB large. Currently -// annotations on documents cannot be specified at import. Any given -// .JSONL file must be 100MB or smaller. +// content must be 10KB or smaller, and also be UTF-8 NFC encoded +// (ASCII already is). +// The document .JSONL file contains, per line, a proto that wraps a +// Document proto. The Document proto must have either document_text +// or input_config set. In document_text case, the Document proto may +// also contain the spatial information of the document, including +// layout, document dimension and page number. In input_config case, +// only PDF documents are supported now, and each document may be up +// to 2MB large. Currently, annotations on documents cannot be +// specified at import. // Three sample CSV rows: // TRAIN,gs://folder/file1.jsonl // VALIDATE,gs://folder/file2.jsonl @@ -162,27 +167,61 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // with artificial line breaks, but the only actual line break is // denoted by \n).: // { -// "text_snippet": { -// "content": "dog car cat" -// } "annotations": [ -// { -// "display_name": "animal", -// "text_extraction": { -// "text_segment": {"start_offset": 0, "end_offset": 3} +// "document": { +// "document_text": {"content": "dog cat"} +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 3, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// }, +// { +// "text_segment": { +// "start_offset": 4, +// "end_offset": 7, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.4, "y": 0.1}, +// {"x": 0.4, "y": 0.3}, +// {"x": 0.8, "y": 0.3}, +// {"x": 0.8, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, // } -// }, +// +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 1, +// }, +// "annotations": [ // { -// "display_name": "vehicle", -// "text_extraction": { -// "text_segment": {"start_offset": 4, "end_offset": 7} -// } +// "display_name": "animal", +// "text_extraction": {"text_segment": {"start_offset": 0, +// "end_offset": 3}} // }, // { // "display_name": "animal", -// "text_extraction": { -// "text_segment": {"start_offset": 8, "end_offset": 11} -// } -// }, +// "text_extraction": {"text_segment": {"start_offset": 4, +// "end_offset": 7}} +// } // ], // }\n // { diff --git a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto index 243849213e38..57f1b794e716 100644 --- a/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto +++ b/google-api-grpc/proto-google-cloud-automl-v1beta1/src/main/proto/google/cloud/automl/v1beta1/prediction_service.proto @@ -18,12 +18,12 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; import "google/cloud/automl/v1beta1/annotation_payload.proto"; import "google/cloud/automl/v1beta1/data_items.proto"; import "google/cloud/automl/v1beta1/io.proto"; import "google/cloud/automl/v1beta1/operations.proto"; import "google/longrunning/operations.proto"; -import "google/api/client.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -38,7 +38,8 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // snake_case or kebab-case, either of those cases is accepted. service PredictionService { option (google.api.default_host) = "automl.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Perform an online prediction. The prediction result will be directly // returned in the response. @@ -66,12 +67,14 @@ service PredictionService { }; } - // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch + // Perform a batch prediction. Unlike the online + // [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch // prediction result won't be immediately available in the response. Instead, // a long running operation object is returned. User can poll the operation // result via [GetOperation][google.longrunning.Operations.GetOperation] - // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in - // the [response][google.longrunning.Operation.response] field. + // method. Once the operation is done, + // [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is + // returned in the [response][google.longrunning.Operation.response] field. // Available for following ML problems: // * Image Classification // * Image Object Detection @@ -86,7 +89,8 @@ service PredictionService { } } -// Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +// Request message for +// [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. message PredictRequest { // Name of the model requested to serve the prediction. string name = 1; @@ -122,12 +126,20 @@ message PredictRequest { map params = 3; } -// Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +// Response message for +// [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. message PredictResponse { // Prediction result. // Translation and Text Sentiment will return precisely one payload. repeated AnnotationPayload payload = 1; + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // * For Text Extraction: + // If the input is a .pdf file, the OCR'ed text will be provided in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + ExamplePayload preprocessed_input = 3; + // Additional domain-specific prediction response metadata. // // * For Image Object Detection: @@ -146,7 +158,8 @@ message PredictResponse { map metadata = 2; } -// Request message for [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +// Request message for +// [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. message BatchPredictRequest { // Name of the model requested to serve the batch prediction. string name = 1; @@ -226,7 +239,8 @@ message BatchPredictRequest { // Result of the Batch Predict. This message is returned in // [response][google.longrunning.Operation.response] of the operation returned -// by the [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +// by the +// [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. message BatchPredictResult { // Additional domain-specific prediction response metadata. // diff --git a/google-cloud-clients/google-cloud-automl/synth.metadata b/google-cloud-clients/google-cloud-automl/synth.metadata index 3cb2a3528a5c..9bf8c4ca388a 100644 --- a/google-cloud-clients/google-cloud-automl/synth.metadata +++ b/google-cloud-clients/google-cloud-automl/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-08-10T07:34:50.395372Z", + "updateTime": "2019-08-16T07:34:42.877845Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2a2c5518f64010c4e458afc818e57ed24fecdf6d", - "internalRef": "262646243" + "sha": "2a02e33c79cbf23d316c57e1c78f915e1d905eee", + "internalRef": "263682410" } } ],