Skip to content

Commit

Permalink
chore(bazel): [documentai] update protobuf to v3.21.12 (#8990)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 503267695

Source-Link: https://togithub.com/googleapis/googleapis/commit/c79059008c6d2e66d4cc65a1a7d8bee7160e3f83

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b98230b9e68a3828cf138296e9a20e03749ae0a0
Copy-Tag: eyJwIjoiamF2YS1kb2N1bWVudC1haS8uT3dsQm90LnlhbWwiLCJoIjoiYjk4MjMwYjllNjhhMzgyOGNmMTM4Mjk2ZTlhMjBlMDM3NDlhZTBhMCJ9

BEGIN_NESTED_COMMIT
feat: [documentai] exposed GetProcessorType to v1
PiperOrigin-RevId: 502624243

Source-Link: https://togithub.com/googleapis/googleapis/commit/bd5f9343ccec979c047c23f43509903a5563633a

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/7ae8a3a9755f661ce8989e9dcb145d2dff77d864
Copy-Tag: eyJwIjoiamF2YS1kb2N1bWVudC1haS8uT3dsQm90LnlhbWwiLCJoIjoiN2FlOGEzYTk3NTVmNjYxY2U4OTg5ZTlkY2IxNDVkMmRmZjc3ZDg2NCJ9
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat: [documentai] exposed GetProcessorType to v1beta3
PiperOrigin-RevId: 502616281

Source-Link: https://togithub.com/googleapis/googleapis/commit/04e6db97c2cbc65141e044029b2e35a70615dc92

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f4bc77f905e68057db09b78397afbddb9b86c80e
Copy-Tag: eyJwIjoiamF2YS1kb2N1bWVudC1haS8uT3dsQm90LnlhbWwiLCJoIjoiZjRiYzc3ZjkwNWU2ODA1N2RiMDliNzgzOTdhZmJkZGI5Yjg2YzgwZSJ9
END_NESTED_COMMIT
  • Loading branch information
gcf-owl-bot[bot] authored Jan 20, 2023
1 parent ede0030 commit 267aa2d
Show file tree
Hide file tree
Showing 193 changed files with 19,680 additions and 12,079 deletions.
6 changes: 3 additions & 3 deletions java-document-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-document-ai</artifactId>
<version>2.11.0</version>
<version>2.12.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-document-ai:2.11.0'
implementation 'com.google.cloud:google-cloud-document-ai:2.12.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.11.0"
libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "2.12.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,121 @@ public final ListProcessorTypesPagedResponse listProcessorTypes(
return stub.listProcessorTypesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a processor type detail.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (DocumentProcessorServiceClient documentProcessorServiceClient =
* DocumentProcessorServiceClient.create()) {
* ProcessorTypeName name = ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]");
* ProcessorType response = documentProcessorServiceClient.getProcessorType(name);
* }
* }</pre>
*
* @param name Required. The processor type resource name.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ProcessorType getProcessorType(ProcessorTypeName name) {
GetProcessorTypeRequest request =
GetProcessorTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getProcessorType(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a processor type detail.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (DocumentProcessorServiceClient documentProcessorServiceClient =
* DocumentProcessorServiceClient.create()) {
* String name = ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString();
* ProcessorType response = documentProcessorServiceClient.getProcessorType(name);
* }
* }</pre>
*
* @param name Required. The processor type resource name.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ProcessorType getProcessorType(String name) {
GetProcessorTypeRequest request = GetProcessorTypeRequest.newBuilder().setName(name).build();
return getProcessorType(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a processor type detail.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (DocumentProcessorServiceClient documentProcessorServiceClient =
* DocumentProcessorServiceClient.create()) {
* GetProcessorTypeRequest request =
* GetProcessorTypeRequest.newBuilder()
* .setName(
* ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
* .build();
* ProcessorType response = documentProcessorServiceClient.getProcessorType(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ProcessorType getProcessorType(GetProcessorTypeRequest request) {
return getProcessorTypeCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a processor type detail.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (DocumentProcessorServiceClient documentProcessorServiceClient =
* DocumentProcessorServiceClient.create()) {
* GetProcessorTypeRequest request =
* GetProcessorTypeRequest.newBuilder()
* .setName(
* ProcessorTypeName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR_TYPE]").toString())
* .build();
* ApiFuture<ProcessorType> future =
* documentProcessorServiceClient.getProcessorTypeCallable().futureCall(request);
* // Do something.
* ProcessorType response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<GetProcessorTypeRequest, ProcessorType> getProcessorTypeCallable() {
return stub.getProcessorTypeCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all processors which belong to this project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ public UnaryCallSettings<BatchProcessRequest, Operation> batchProcessDocumentsSe
return ((DocumentProcessorServiceStubSettings) getStubSettings()).listProcessorTypesSettings();
}

/** Returns the object with the settings used for calls to getProcessorType. */
public UnaryCallSettings<GetProcessorTypeRequest, ProcessorType> getProcessorTypeSettings() {
return ((DocumentProcessorServiceStubSettings) getStubSettings()).getProcessorTypeSettings();
}

/** Returns the object with the settings used for calls to listProcessors. */
public PagedCallSettings<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
Expand Down Expand Up @@ -425,6 +430,12 @@ public UnaryCallSettings.Builder<ProcessRequest, ProcessResponse> processDocumen
return getStubSettingsBuilder().listProcessorTypesSettings();
}

/** Returns the builder for the settings used for calls to getProcessorType. */
public UnaryCallSettings.Builder<GetProcessorTypeRequest, ProcessorType>
getProcessorTypeSettings() {
return getStubSettingsBuilder().getProcessorTypeSettings();
}

/** Returns the builder for the settings used for calls to listProcessors. */
public PagedCallSettings.Builder<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"GetProcessor": {
"methods": ["getProcessor", "getProcessor", "getProcessor", "getProcessorCallable"]
},
"GetProcessorType": {
"methods": ["getProcessorType", "getProcessorType", "getProcessorType", "getProcessorTypeCallable"]
},
"GetProcessorVersion": {
"methods": ["getProcessorVersion", "getProcessorVersion", "getProcessorVersion", "getProcessorVersionCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.google.cloud.documentai.v1.FetchProcessorTypesRequest;
import com.google.cloud.documentai.v1.FetchProcessorTypesResponse;
import com.google.cloud.documentai.v1.GetProcessorRequest;
import com.google.cloud.documentai.v1.GetProcessorTypeRequest;
import com.google.cloud.documentai.v1.GetProcessorVersionRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesResponse;
Expand All @@ -54,6 +55,7 @@
import com.google.cloud.documentai.v1.ProcessRequest;
import com.google.cloud.documentai.v1.ProcessResponse;
import com.google.cloud.documentai.v1.Processor;
import com.google.cloud.documentai.v1.ProcessorType;
import com.google.cloud.documentai.v1.ProcessorVersion;
import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata;
import com.google.cloud.documentai.v1.ReviewDocumentRequest;
Expand Down Expand Up @@ -119,6 +121,10 @@ public UnaryCallable<BatchProcessRequest, Operation> batchProcessDocumentsCallab
throw new UnsupportedOperationException("Not implemented: listProcessorTypesCallable()");
}

public UnaryCallable<GetProcessorTypeRequest, ProcessorType> getProcessorTypeCallable() {
throw new UnsupportedOperationException("Not implemented: getProcessorTypeCallable()");
}

public UnaryCallable<ListProcessorsRequest, ListProcessorsPagedResponse>
listProcessorsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listProcessorsPagedCallable()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import com.google.cloud.documentai.v1.FetchProcessorTypesRequest;
import com.google.cloud.documentai.v1.FetchProcessorTypesResponse;
import com.google.cloud.documentai.v1.GetProcessorRequest;
import com.google.cloud.documentai.v1.GetProcessorTypeRequest;
import com.google.cloud.documentai.v1.GetProcessorVersionRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesResponse;
Expand Down Expand Up @@ -161,6 +162,7 @@ public class DocumentProcessorServiceStubSettings
private final PagedCallSettings<
ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse>
listProcessorTypesSettings;
private final UnaryCallSettings<GetProcessorTypeRequest, ProcessorType> getProcessorTypeSettings;
private final PagedCallSettings<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
listProcessorsSettings;
Expand Down Expand Up @@ -481,6 +483,11 @@ public UnaryCallSettings<BatchProcessRequest, Operation> batchProcessDocumentsSe
return listProcessorTypesSettings;
}

/** Returns the object with the settings used for calls to getProcessorType. */
public UnaryCallSettings<GetProcessorTypeRequest, ProcessorType> getProcessorTypeSettings() {
return getProcessorTypeSettings;
}

/** Returns the object with the settings used for calls to listProcessors. */
public PagedCallSettings<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
Expand Down Expand Up @@ -740,6 +747,7 @@ protected DocumentProcessorServiceStubSettings(Builder settingsBuilder) throws I
settingsBuilder.batchProcessDocumentsOperationSettings().build();
fetchProcessorTypesSettings = settingsBuilder.fetchProcessorTypesSettings().build();
listProcessorTypesSettings = settingsBuilder.listProcessorTypesSettings().build();
getProcessorTypeSettings = settingsBuilder.getProcessorTypeSettings().build();
listProcessorsSettings = settingsBuilder.listProcessorsSettings().build();
getProcessorSettings = settingsBuilder.getProcessorSettings().build();
getProcessorVersionSettings = settingsBuilder.getProcessorVersionSettings().build();
Expand Down Expand Up @@ -786,6 +794,8 @@ public static class Builder
private final PagedCallSettings.Builder<
ListProcessorTypesRequest, ListProcessorTypesResponse, ListProcessorTypesPagedResponse>
listProcessorTypesSettings;
private final UnaryCallSettings.Builder<GetProcessorTypeRequest, ProcessorType>
getProcessorTypeSettings;
private final PagedCallSettings.Builder<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
listProcessorsSettings;
Expand Down Expand Up @@ -897,6 +907,7 @@ protected Builder(ClientContext clientContext) {
batchProcessDocumentsOperationSettings = OperationCallSettings.newBuilder();
fetchProcessorTypesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listProcessorTypesSettings = PagedCallSettings.newBuilder(LIST_PROCESSOR_TYPES_PAGE_STR_FACT);
getProcessorTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listProcessorsSettings = PagedCallSettings.newBuilder(LIST_PROCESSORS_PAGE_STR_FACT);
getProcessorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getProcessorVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
Expand Down Expand Up @@ -928,6 +939,7 @@ protected Builder(ClientContext clientContext) {
batchProcessDocumentsSettings,
fetchProcessorTypesSettings,
listProcessorTypesSettings,
getProcessorTypeSettings,
listProcessorsSettings,
getProcessorSettings,
getProcessorVersionSettings,
Expand Down Expand Up @@ -955,6 +967,7 @@ protected Builder(DocumentProcessorServiceStubSettings settings) {
settings.batchProcessDocumentsOperationSettings.toBuilder();
fetchProcessorTypesSettings = settings.fetchProcessorTypesSettings.toBuilder();
listProcessorTypesSettings = settings.listProcessorTypesSettings.toBuilder();
getProcessorTypeSettings = settings.getProcessorTypeSettings.toBuilder();
listProcessorsSettings = settings.listProcessorsSettings.toBuilder();
getProcessorSettings = settings.getProcessorSettings.toBuilder();
getProcessorVersionSettings = settings.getProcessorVersionSettings.toBuilder();
Expand Down Expand Up @@ -989,6 +1002,7 @@ protected Builder(DocumentProcessorServiceStubSettings settings) {
batchProcessDocumentsSettings,
fetchProcessorTypesSettings,
listProcessorTypesSettings,
getProcessorTypeSettings,
listProcessorsSettings,
getProcessorSettings,
getProcessorVersionSettings,
Expand Down Expand Up @@ -1053,6 +1067,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.getProcessorTypeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.listProcessorsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
Expand Down Expand Up @@ -1404,6 +1423,12 @@ public UnaryCallSettings.Builder<ProcessRequest, ProcessResponse> processDocumen
return listProcessorTypesSettings;
}

/** Returns the builder for the settings used for calls to getProcessorType. */
public UnaryCallSettings.Builder<GetProcessorTypeRequest, ProcessorType>
getProcessorTypeSettings() {
return getProcessorTypeSettings;
}

/** Returns the builder for the settings used for calls to listProcessors. */
public PagedCallSettings.Builder<
ListProcessorsRequest, ListProcessorsResponse, ListProcessorsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.google.cloud.documentai.v1.FetchProcessorTypesRequest;
import com.google.cloud.documentai.v1.FetchProcessorTypesResponse;
import com.google.cloud.documentai.v1.GetProcessorRequest;
import com.google.cloud.documentai.v1.GetProcessorTypeRequest;
import com.google.cloud.documentai.v1.GetProcessorVersionRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesRequest;
import com.google.cloud.documentai.v1.ListProcessorTypesResponse;
Expand All @@ -58,6 +59,7 @@
import com.google.cloud.documentai.v1.ProcessRequest;
import com.google.cloud.documentai.v1.ProcessResponse;
import com.google.cloud.documentai.v1.Processor;
import com.google.cloud.documentai.v1.ProcessorType;
import com.google.cloud.documentai.v1.ProcessorVersion;
import com.google.cloud.documentai.v1.ReviewDocumentOperationMetadata;
import com.google.cloud.documentai.v1.ReviewDocumentRequest;
Expand Down Expand Up @@ -134,6 +136,17 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt
ProtoUtils.marshaller(ListProcessorTypesResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetProcessorTypeRequest, ProcessorType>
getProcessorTypeMethodDescriptor =
MethodDescriptor.<GetProcessorTypeRequest, ProcessorType>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType")
.setRequestMarshaller(
ProtoUtils.marshaller(GetProcessorTypeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ProcessorType.getDefaultInstance()))
.build();

private static final MethodDescriptor<ListProcessorsRequest, ListProcessorsResponse>
listProcessorsMethodDescriptor =
MethodDescriptor.<ListProcessorsRequest, ListProcessorsResponse>newBuilder()
Expand Down Expand Up @@ -306,6 +319,7 @@ public class GrpcDocumentProcessorServiceStub extends DocumentProcessorServiceSt
listProcessorTypesCallable;
private final UnaryCallable<ListProcessorTypesRequest, ListProcessorTypesPagedResponse>
listProcessorTypesPagedCallable;
private final UnaryCallable<GetProcessorTypeRequest, ProcessorType> getProcessorTypeCallable;
private final UnaryCallable<ListProcessorsRequest, ListProcessorsResponse> listProcessorsCallable;
private final UnaryCallable<ListProcessorsRequest, ListProcessorsPagedResponse>
listProcessorsPagedCallable;
Expand Down Expand Up @@ -450,6 +464,16 @@ protected GrpcDocumentProcessorServiceStub(
return params.build();
})
.build();
GrpcCallSettings<GetProcessorTypeRequest, ProcessorType> getProcessorTypeTransportSettings =
GrpcCallSettings.<GetProcessorTypeRequest, ProcessorType>newBuilder()
.setMethodDescriptor(getProcessorTypeMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<ListProcessorsRequest, ListProcessorsResponse>
listProcessorsTransportSettings =
GrpcCallSettings.<ListProcessorsRequest, ListProcessorsResponse>newBuilder()
Expand Down Expand Up @@ -638,6 +662,9 @@ protected GrpcDocumentProcessorServiceStub(
listProcessorTypesTransportSettings,
settings.listProcessorTypesSettings(),
clientContext);
this.getProcessorTypeCallable =
callableFactory.createUnaryCallable(
getProcessorTypeTransportSettings, settings.getProcessorTypeSettings(), clientContext);
this.listProcessorsCallable =
callableFactory.createUnaryCallable(
listProcessorsTransportSettings, settings.listProcessorsSettings(), clientContext);
Expand Down Expand Up @@ -797,6 +824,11 @@ public UnaryCallable<BatchProcessRequest, Operation> batchProcessDocumentsCallab
return listProcessorTypesPagedCallable;
}

@Override
public UnaryCallable<GetProcessorTypeRequest, ProcessorType> getProcessorTypeCallable() {
return getProcessorTypeCallable;
}

@Override
public UnaryCallable<ListProcessorsRequest, ListProcessorsResponse> listProcessorsCallable() {
return listProcessorsCallable;
Expand Down
Loading

0 comments on commit 267aa2d

Please sign in to comment.