Skip to content

Commit c873d10

Browse files
feat: [documentai] add StyleInfo to document.proto (#9551)
* feat: add StyleInfo to document.proto feat: add REPLACE enum to OperationType in document.proto feat: add PropertyMetadata and EntityTypeMetadata to document_schema.proto feat: add IMPORTING enum to State in processor.proto chore: updated comments PiperOrigin-RevId: 540932243 Source-Link: googleapis/googleapis@120a89c Source-Link: https://github.com/googleapis/googleapis-gen/commit/82a61cd89b4899ac94c87791916b77bf2ab73d16 Copy-Tag: eyJwIjoiamF2YS1kb2N1bWVudC1haS8uT3dsQm90LnlhbWwiLCJoIjoiODJhNjFjZDg5YjQ4OTlhYzk0Yzg3NzkxOTE2Yjc3YmYyYWI3M2QxNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add StyleInfo to document.proto feat: add IMPORTING enum to State in processor.proto chore: updated comments PiperOrigin-RevId: 540937637 Source-Link: googleapis/googleapis@b2b3723 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f620d19ce9a3aaf50136c9985d605106f72baeb Copy-Tag: eyJwIjoiamF2YS1kb2N1bWVudC1haS8uT3dsQm90LnlhbWwiLCJoIjoiOWY2MjBkMTljZTlhM2FhZjUwMTM2Yzk5ODVkNjA1MTA2ZjcyYmFlYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f399914 commit c873d10

File tree

260 files changed

+30727
-3766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+30727
-3766
lines changed

java-document-ai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.16.0</version>
23+
<version>26.17.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>

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

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
// AUTO-GENERATED DOCUMENTATION AND CLASS.
4747
/**
48-
* Service Description: Service to call Cloud DocumentAI to process documents according to the
48+
* Service Description: Service to call Document AI to process documents according to the
4949
* processor's definition. Processors are built using state-of-the-art Google AI such as natural
5050
* language, computer vision, and translation to extract structured information from unstructured or
5151
* semi-structured documents.
@@ -525,8 +525,9 @@ public final UnaryCallable<BatchProcessRequest, Operation> batchProcessDocuments
525525

526526
// AUTO-GENERATED DOCUMENTATION AND METHOD.
527527
/**
528-
* Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
529-
* paginated.
528+
* Fetches processor types. Note that we don't use
529+
* [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
530+
* here, because it isn't paginated.
530531
*
531532
* <p>Sample code:
532533
*
@@ -544,9 +545,8 @@ public final UnaryCallable<BatchProcessRequest, Operation> batchProcessDocuments
544545
* }
545546
* }</pre>
546547
*
547-
* @param parent Required. The project of processor type to list. The available processor types
548-
* may depend on the allow-listing on projects. Format:
549-
* `projects/{project}/locations/{location}`
548+
* @param parent Required. The location of processor types to list. Format:
549+
* `projects/{project}/locations/{location}`.
550550
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
551551
*/
552552
public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent) {
@@ -559,8 +559,9 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent
559559

560560
// AUTO-GENERATED DOCUMENTATION AND METHOD.
561561
/**
562-
* Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
563-
* paginated.
562+
* Fetches processor types. Note that we don't use
563+
* [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
564+
* here, because it isn't paginated.
564565
*
565566
* <p>Sample code:
566567
*
@@ -578,9 +579,8 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(LocationName parent
578579
* }
579580
* }</pre>
580581
*
581-
* @param parent Required. The project of processor type to list. The available processor types
582-
* may depend on the allow-listing on projects. Format:
583-
* `projects/{project}/locations/{location}`
582+
* @param parent Required. The location of processor types to list. Format:
583+
* `projects/{project}/locations/{location}`.
584584
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
585585
*/
586586
public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) {
@@ -591,8 +591,9 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(String parent) {
591591

592592
// AUTO-GENERATED DOCUMENTATION AND METHOD.
593593
/**
594-
* Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
595-
* paginated.
594+
* Fetches processor types. Note that we don't use
595+
* [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
596+
* here, because it isn't paginated.
596597
*
597598
* <p>Sample code:
598599
*
@@ -622,8 +623,9 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypes
622623

623624
// AUTO-GENERATED DOCUMENTATION AND METHOD.
624625
/**
625-
* Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
626-
* paginated.
626+
* Fetches processor types. Note that we don't use
627+
* [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
628+
* here, because it isn't paginated.
627629
*
628630
* <p>Sample code:
629631
*
@@ -673,9 +675,8 @@ public final FetchProcessorTypesResponse fetchProcessorTypes(FetchProcessorTypes
673675
* }
674676
* }</pre>
675677
*
676-
* @param parent Required. The location of processor type to list. The available processor types
677-
* may depend on the allow-listing on projects. Format:
678-
* `projects/{project}/locations/{location}`
678+
* @param parent Required. The location of processor types to list. Format:
679+
* `projects/{project}/locations/{location}`.
679680
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
680681
*/
681682
public final ListProcessorTypesPagedResponse listProcessorTypes(LocationName parent) {
@@ -708,9 +709,8 @@ public final ListProcessorTypesPagedResponse listProcessorTypes(LocationName par
708709
* }
709710
* }</pre>
710711
*
711-
* @param parent Required. The location of processor type to list. The available processor types
712-
* may depend on the allow-listing on projects. Format:
713-
* `projects/{project}/locations/{location}`
712+
* @param parent Required. The location of processor types to list. Format:
713+
* `projects/{project}/locations/{location}`.
714714
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
715715
*/
716716
public final ListProcessorTypesPagedResponse listProcessorTypes(String parent) {
@@ -1232,7 +1232,7 @@ public final UnaryCallable<GetProcessorRequest, Processor> getProcessorCallable(
12321232
// AUTO-GENERATED DOCUMENTATION AND METHOD.
12331233
/**
12341234
* Trains a new processor version. Operation metadata is returned as
1235-
* cloud_documentai_core.TrainProcessorVersionMetadata.
1235+
* [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
12361236
*
12371237
* <p>Sample code:
12381238
*
@@ -1269,7 +1269,7 @@ public final UnaryCallable<GetProcessorRequest, Processor> getProcessorCallable(
12691269
// AUTO-GENERATED DOCUMENTATION AND METHOD.
12701270
/**
12711271
* Trains a new processor version. Operation metadata is returned as
1272-
* cloud_documentai_core.TrainProcessorVersionMetadata.
1272+
* [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
12731273
*
12741274
* <p>Sample code:
12751275
*
@@ -1306,7 +1306,7 @@ public final UnaryCallable<GetProcessorRequest, Processor> getProcessorCallable(
13061306
// AUTO-GENERATED DOCUMENTATION AND METHOD.
13071307
/**
13081308
* Trains a new processor version. Operation metadata is returned as
1309-
* cloud_documentai_core.TrainProcessorVersionMetadata.
1309+
* [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
13101310
*
13111311
* <p>Sample code:
13121312
*
@@ -1342,7 +1342,7 @@ public final UnaryCallable<GetProcessorRequest, Processor> getProcessorCallable(
13421342
// AUTO-GENERATED DOCUMENTATION AND METHOD.
13431343
/**
13441344
* Trains a new processor version. Operation metadata is returned as
1345-
* cloud_documentai_core.TrainProcessorVersionMetadata.
1345+
* [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
13461346
*
13471347
* <p>Sample code:
13481348
*
@@ -1382,7 +1382,7 @@ public final UnaryCallable<GetProcessorRequest, Processor> getProcessorCallable(
13821382
// AUTO-GENERATED DOCUMENTATION AND METHOD.
13831383
/**
13841384
* Trains a new processor version. Operation metadata is returned as
1385-
* cloud_documentai_core.TrainProcessorVersionMetadata.
1385+
* [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].
13861386
*
13871387
* <p>Sample code:
13881388
*
@@ -2223,8 +2223,8 @@ public final OperationFuture<Empty, DeleteProcessorVersionMetadata> deleteProces
22232223

22242224
// AUTO-GENERATED DOCUMENTATION AND METHOD.
22252225
/**
2226-
* Creates a processor from the type processor that the user chose. The processor will be at
2227-
* "ENABLED" state by default after its creation.
2226+
* Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
2227+
* provided. The processor will be at `ENABLED` state by default after its creation.
22282228
*
22292229
* <p>Sample code:
22302230
*
@@ -2244,8 +2244,11 @@ public final OperationFuture<Empty, DeleteProcessorVersionMetadata> deleteProces
22442244
*
22452245
* @param parent Required. The parent (project and location) under which to create the processor.
22462246
* Format: `projects/{project}/locations/{location}`
2247-
* @param processor Required. The processor to be created, requires [processor_type] and
2248-
* [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set.
2247+
* @param processor Required. The processor to be created, requires
2248+
* [Processor.type][google.cloud.documentai.v1.Processor.type] and [Processor.display_name]][]
2249+
* to be set. Also, the
2250+
* [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] field must be
2251+
* set if the processor is under CMEK.
22492252
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
22502253
*/
22512254
public final Processor createProcessor(LocationName parent, Processor processor) {
@@ -2259,8 +2262,8 @@ public final Processor createProcessor(LocationName parent, Processor processor)
22592262

22602263
// AUTO-GENERATED DOCUMENTATION AND METHOD.
22612264
/**
2262-
* Creates a processor from the type processor that the user chose. The processor will be at
2263-
* "ENABLED" state by default after its creation.
2265+
* Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
2266+
* provided. The processor will be at `ENABLED` state by default after its creation.
22642267
*
22652268
* <p>Sample code:
22662269
*
@@ -2280,8 +2283,11 @@ public final Processor createProcessor(LocationName parent, Processor processor)
22802283
*
22812284
* @param parent Required. The parent (project and location) under which to create the processor.
22822285
* Format: `projects/{project}/locations/{location}`
2283-
* @param processor Required. The processor to be created, requires [processor_type] and
2284-
* [display_name] to be set. Also, the processor is under CMEK if CMEK fields are set.
2286+
* @param processor Required. The processor to be created, requires
2287+
* [Processor.type][google.cloud.documentai.v1.Processor.type] and [Processor.display_name]][]
2288+
* to be set. Also, the
2289+
* [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] field must be
2290+
* set if the processor is under CMEK.
22852291
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
22862292
*/
22872293
public final Processor createProcessor(String parent, Processor processor) {
@@ -2292,8 +2298,8 @@ public final Processor createProcessor(String parent, Processor processor) {
22922298

22932299
// AUTO-GENERATED DOCUMENTATION AND METHOD.
22942300
/**
2295-
* Creates a processor from the type processor that the user chose. The processor will be at
2296-
* "ENABLED" state by default after its creation.
2301+
* Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
2302+
* provided. The processor will be at `ENABLED` state by default after its creation.
22972303
*
22982304
* <p>Sample code:
22992305
*
@@ -2323,8 +2329,8 @@ public final Processor createProcessor(CreateProcessorRequest request) {
23232329

23242330
// AUTO-GENERATED DOCUMENTATION AND METHOD.
23252331
/**
2326-
* Creates a processor from the type processor that the user chose. The processor will be at
2327-
* "ENABLED" state by default after its creation.
2332+
* Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType]
2333+
* provided. The processor will be at `ENABLED` state by default after its creation.
23282334
*
23292335
* <p>Sample code:
23302336
*
@@ -2825,8 +2831,9 @@ public final UnaryCallable<DisableProcessorRequest, Operation> disableProcessorC
28252831
* }
28262832
* }</pre>
28272833
*
2828-
* @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document
2829-
* will be reviewed with.
2834+
* @param humanReviewConfig Required. The resource name of the
2835+
* [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be
2836+
* reviewed with.
28302837
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
28312838
*/
28322839
public final OperationFuture<ReviewDocumentResponse, ReviewDocumentOperationMetadata>
@@ -2860,8 +2867,9 @@ public final UnaryCallable<DisableProcessorRequest, Operation> disableProcessorC
28602867
* }
28612868
* }</pre>
28622869
*
2863-
* @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document
2864-
* will be reviewed with.
2870+
* @param humanReviewConfig Required. The resource name of the
2871+
* [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the document will be
2872+
* reviewed with.
28652873
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
28662874
*/
28672875
public final OperationFuture<ReviewDocumentResponse, ReviewDocumentOperationMetadata>

java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* <p>======================= DocumentProcessorServiceClient =======================
2323
*
24-
* <p>Service Description: Service to call Cloud DocumentAI to process documents according to the
24+
* <p>Service Description: Service to call Document AI to process documents according to the
2525
* processor's definition. Processors are built using state-of-the-art Google AI such as natural
2626
* language, computer vision, and translation to extract structured information from unstructured or
2727
* semi-structured documents.

java-document-ai/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1/stub/DocumentProcessorServiceStubSettings.java

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,11 @@ public static class Builder
10231023
ImmutableSet.copyOf(
10241024
Lists.<StatusCode.Code>newArrayList(
10251025
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
1026+
definitions.put(
1027+
"retry_policy_1_codes",
1028+
ImmutableSet.copyOf(
1029+
Lists.<StatusCode.Code>newArrayList(
1030+
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
10261031
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
10271032
RETRYABLE_CODE_DEFINITIONS = definitions.build();
10281033
}
@@ -1032,6 +1037,17 @@ public static class Builder
10321037
static {
10331038
ImmutableMap.Builder<String, RetrySettings> definitions = ImmutableMap.builder();
10341039
RetrySettings settings = null;
1040+
settings =
1041+
RetrySettings.newBuilder()
1042+
.setInitialRetryDelay(Duration.ofMillis(100L))
1043+
.setRetryDelayMultiplier(1.3)
1044+
.setMaxRetryDelay(Duration.ofMillis(60000L))
1045+
.setInitialRpcTimeout(Duration.ofMillis(300000L))
1046+
.setRpcTimeoutMultiplier(1.0)
1047+
.setMaxRpcTimeout(Duration.ofMillis(300000L))
1048+
.setTotalTimeout(Duration.ofMillis(300000L))
1049+
.build();
1050+
definitions.put("retry_policy_0_params", settings);
10351051
settings =
10361052
RetrySettings.newBuilder()
10371053
.setInitialRetryDelay(Duration.ofMillis(100L))
@@ -1042,7 +1058,7 @@ public static class Builder
10421058
.setMaxRpcTimeout(Duration.ofMillis(120000L))
10431059
.setTotalTimeout(Duration.ofMillis(120000L))
10441060
.build();
1045-
definitions.put("retry_policy_0_params", settings);
1061+
definitions.put("retry_policy_1_params", settings);
10461062
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
10471063
definitions.put("no_retry_params", settings);
10481064
RETRY_PARAM_DEFINITIONS = definitions.build();
@@ -1229,8 +1245,8 @@ private static Builder initDefaults(Builder builder) {
12291245

12301246
builder
12311247
.batchProcessDocumentsSettings()
1232-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1233-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
1248+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1249+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
12341250

12351251
builder
12361252
.fetchProcessorTypesSettings()
@@ -1314,8 +1330,8 @@ private static Builder initDefaults(Builder builder) {
13141330

13151331
builder
13161332
.reviewDocumentSettings()
1317-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1318-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
1333+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1334+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
13191335

13201336
builder
13211337
.evaluateProcessorVersionSettings()
@@ -1347,8 +1363,8 @@ private static Builder initDefaults(Builder builder) {
13471363
.setInitialCallSettings(
13481364
UnaryCallSettings
13491365
.<BatchProcessRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
1350-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1351-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"))
1366+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1367+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
13521368
.build())
13531369
.setResponseTransformer(
13541370
ProtoOperationTransformers.ResponseTransformer.create(BatchProcessResponse.class))
@@ -1573,8 +1589,8 @@ private static Builder initDefaults(Builder builder) {
15731589
.setInitialCallSettings(
15741590
UnaryCallSettings
15751591
.<ReviewDocumentRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
1576-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1577-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"))
1592+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
1593+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
15781594
.build())
15791595
.setResponseTransformer(
15801596
ProtoOperationTransformers.ResponseTransformer.create(ReviewDocumentResponse.class))

0 commit comments

Comments
 (0)