diff --git a/.kokoro/build.sh b/.kokoro/build.sh index e62d0321..ce220d5f 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) ## cd to the parent directory, i.e. the root of the git repo cd ${scriptDir}/.. +# include common functions +source ${scriptDir}/common.sh + # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C # if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..a3bbc5f6 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# set -eo pipefail + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + echo "${command}" + ${command} + exit_code=$? + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index f326e3cd..0aade871 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -15,7 +15,13 @@ set -eo pipefail -cd github/java-document-ai/ +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java java -version @@ -24,8 +30,9 @@ echo $JOB_TYPE export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index 34e98e92..759ab4e2 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -17,18 +17,26 @@ set -eo pipefail # Display commands being run. set -x -cd github/java-document-ai/ +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true # Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR JAR=linkage-monitor-latest-all-deps.jar diff --git a/CHANGELOG.md b/CHANGELOG.md index 7528ebf4..22bd8686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +### [0.1.1](https://www.github.com/googleapis/java-document-ai/compare/v0.1.0...v0.1.1) (2020-04-07) + + +### Bug Fixes + +* **v1beta2:** set default endpoint to us-documentai.googleapis.com ([#44](https://www.github.com/googleapis/java-document-ai/issues/44)) ([1b928a1](https://www.github.com/googleapis/java-document-ai/commit/1b928a1de50f8a8ba141d4c8492cfeda7a3b6c80)) + + +### Dependencies + +* update core dependencies ([#10](https://www.github.com/googleapis/java-document-ai/issues/10)) ([aa252ef](https://www.github.com/googleapis/java-document-ai/commit/aa252ef3b3aa3bab3fb99224ac0e4e70d8167266)) +* update dependency com.google.api:api-common to v1.9.0 ([#37](https://www.github.com/googleapis/java-document-ai/issues/37)) ([ec3b6cc](https://www.github.com/googleapis/java-document-ai/commit/ec3b6cc5f7b424350d3e79ed478a2a4e7d537124)) +* update dependency org.threeten:threetenbp to v1.4.3 ([#29](https://www.github.com/googleapis/java-document-ai/issues/29)) ([ec57073](https://www.github.com/googleapis/java-document-ai/commit/ec5707332800e82aef0735b17451a7c555e4fa92)) + ## 0.1.0 (2020-03-16) diff --git a/README.md b/README.md index 6d93f936..32481a0a 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,19 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 4.2.0 + 4.4.1 pom import + com.google.cloud google-cloud-document-ai - + ``` [//]: # ({x-version-update-start:google-cloud-document-ai:released}) @@ -42,17 +43,18 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-document-ai - 0.1.0 + 0.1.1 + ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-document-ai:0.1.0' +compile 'com.google.cloud:google-cloud-document-ai:0.1.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "0.1.0" +libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "0.1.1" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-document-ai-bom/pom.xml b/google-cloud-document-ai-bom/pom.xml index 7e847ac1..97d42400 100644 --- a/google-cloud-document-ai-bom/pom.xml +++ b/google-cloud-document-ai-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-document-ai-bom - 0.1.0 + 0.1.1 pom com.google.cloud @@ -61,27 +61,27 @@ com.google.api.grpc proto-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 com.google.api.grpc proto-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 com.google.api.grpc grpc-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 com.google.api.grpc grpc-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 com.google.cloud google-cloud-document-ai - 0.1.0 + 0.1.1 diff --git a/google-cloud-document-ai/pom.xml b/google-cloud-document-ai/pom.xml index e7209b61..722ca587 100644 --- a/google-cloud-document-ai/pom.xml +++ b/google-cloud-document-ai/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-document-ai - 0.1.0 + 0.1.1 jar Google Cloud Document AI https://github.com/googleapis/java-documentai @@ -11,7 +11,7 @@ com.google.cloud google-cloud-document-ai-parent - 0.1.0 + 0.1.1 google-cloud-document-ai diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java index a3111385..33dc230e 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClient.java @@ -41,7 +41,10 @@ *
  * 
  * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
- *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+ *   InputConfig inputConfig = InputConfig.newBuilder().build();
+ *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder()
+ *     .setInputConfig(inputConfig)
+ *     .build();
  *   Document response = documentUnderstandingServiceClient.processDocument(request);
  * }
  * 
@@ -280,7 +283,10 @@ public final OperationsClient getOperationsClient() {
    *
    * 

    * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
-   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder()
+   *     .setInputConfig(inputConfig)
+   *     .build();
    *   Document response = documentUnderstandingServiceClient.processDocument(request);
    * }
    * 
@@ -300,7 +306,10 @@ public final Document processDocument(ProcessDocumentRequest request) { * *

    * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
-   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder()
+   *     .setInputConfig(inputConfig)
+   *     .build();
    *   ApiFuture<Document> future = documentUnderstandingServiceClient.processDocumentCallable().futureCall(request);
    *   // Do something
    *   Document response = future.get();
diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java
index db7606aa..fe466b58 100644
--- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java
+++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceSettings.java
@@ -39,7 +39,7 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (documentai.googleapis.com) and default port (443) are used. + *
  • The default service address (us-documentai.googleapis.com) and default port (443) are used. *
  • Credentials are acquired automatically through Application Default Credentials. *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java index 62a42566..07963129 100644 --- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java +++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/package-info.java @@ -31,7 +31,10 @@ *
  * 
  * try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
- *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
+ *   InputConfig inputConfig = InputConfig.newBuilder().build();
+ *   ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder()
+ *     .setInputConfig(inputConfig)
+ *     .build();
  *   Document response = documentUnderstandingServiceClient.processDocument(request);
  * }
  * 
diff --git a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java
index d74b5e80..e92716f8 100644
--- a/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java
+++ b/google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java
@@ -56,7 +56,7 @@
  * 

The default instance has everything set to sensible defaults: * *

    - *
  • The default service address (documentai.googleapis.com) and default port (443) are used. + *
  • The default service address (us-documentai.googleapis.com) and default port (443) are used. *
  • Credentials are acquired automatically through Application Default Credentials. *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
@@ -133,7 +133,7 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { - return "documentai.googleapis.com:443"; + return "us-documentai.googleapis.com:443"; } /** Returns the default service scopes. */ @@ -293,13 +293,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setInitialRetryDelay(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setMaxRetryDelay(Duration.ofMillis(5000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(86400000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; diff --git a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java index 0f3f15f3..3b5b31c2 100644 --- a/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java +++ b/google-cloud-document-ai/src/test/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceClientTest.java @@ -139,7 +139,9 @@ public void processDocumentTest() { Document.newBuilder().setUri(uri).setMimeType(mimeType).setText(text).build(); mockDocumentUnderstandingService.addResponse(expectedResponse); - ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build(); + InputConfig inputConfig = InputConfig.newBuilder().build(); + ProcessDocumentRequest request = + ProcessDocumentRequest.newBuilder().setInputConfig(inputConfig).build(); Document actualResponse = client.processDocument(request); Assert.assertEquals(expectedResponse, actualResponse); @@ -148,6 +150,7 @@ public void processDocumentTest() { Assert.assertEquals(1, actualRequests.size()); ProcessDocumentRequest actualRequest = (ProcessDocumentRequest) actualRequests.get(0); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -161,7 +164,9 @@ public void processDocumentExceptionTest() throws Exception { mockDocumentUnderstandingService.addException(exception); try { - ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build(); + InputConfig inputConfig = InputConfig.newBuilder().build(); + ProcessDocumentRequest request = + ProcessDocumentRequest.newBuilder().setInputConfig(inputConfig).build(); client.processDocument(request); Assert.fail("No exception raised"); diff --git a/grpc-google-cloud-document-ai-v1beta1/pom.xml b/grpc-google-cloud-document-ai-v1beta1/pom.xml index de9c6349..19329c5e 100644 --- a/grpc-google-cloud-document-ai-v1beta1/pom.xml +++ b/grpc-google-cloud-document-ai-v1beta1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 grpc-google-cloud-document-ai-v1beta1 GRPC library for grpc-google-cloud-document-ai-v1beta1 com.google.cloud google-cloud-document-ai-parent - 0.1.0 + 0.1.1 diff --git a/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java b/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java index 4e2477f9..437a1671 100644 --- a/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java +++ b/grpc-google-cloud-document-ai-v1beta1/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceGrpc.java @@ -96,19 +96,43 @@ private DocumentUnderstandingServiceGrpc() {} /** Creates a new async stub that supports all call types for the service */ public static DocumentUnderstandingServiceStub newStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static DocumentUnderstandingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceBlockingStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceBlockingStub.newStub(factory, channel); } /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static DocumentUnderstandingServiceFutureStub newFutureStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceFutureStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceFutureStub.newStub(factory, channel); } /** @@ -159,11 +183,7 @@ public final io.grpc.ServerServiceDefinition bindService() { *
*/ public static final class DocumentUnderstandingServiceStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractAsyncStub { private DocumentUnderstandingServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -202,11 +222,7 @@ public void batchProcessDocuments( *
*/ public static final class DocumentUnderstandingServiceBlockingStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceBlockingStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractBlockingStub { private DocumentUnderstandingServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -242,11 +258,7 @@ public com.google.longrunning.Operation batchProcessDocuments( *
*/ public static final class DocumentUnderstandingServiceFutureStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceFutureStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractFutureStub { private DocumentUnderstandingServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); diff --git a/grpc-google-cloud-document-ai-v1beta2/pom.xml b/grpc-google-cloud-document-ai-v1beta2/pom.xml index 5e120401..479ede42 100644 --- a/grpc-google-cloud-document-ai-v1beta2/pom.xml +++ b/grpc-google-cloud-document-ai-v1beta2/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 grpc-google-cloud-document-ai-v1beta2 GRPC library for grpc-google-cloud-document-ai-v1beta2 com.google.cloud google-cloud-document-ai-parent - 0.1.0 + 0.1.1 diff --git a/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java b/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java index 6a2668bd..0de58fb5 100644 --- a/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java +++ b/grpc-google-cloud-document-ai-v1beta2/src/main/java/com/google/cloud/documentai/v1beta2/DocumentUnderstandingServiceGrpc.java @@ -145,19 +145,43 @@ private DocumentUnderstandingServiceGrpc() {} /** Creates a new async stub that supports all call types for the service */ public static DocumentUnderstandingServiceStub newStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static DocumentUnderstandingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceBlockingStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceBlockingStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceBlockingStub.newStub(factory, channel); } /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static DocumentUnderstandingServiceFutureStub newFutureStub(io.grpc.Channel channel) { - return new DocumentUnderstandingServiceFutureStub(channel); + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentUnderstandingServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentUnderstandingServiceFutureStub(channel, callOptions); + } + }; + return DocumentUnderstandingServiceFutureStub.newStub(factory, channel); } /** @@ -230,11 +254,7 @@ public final io.grpc.ServerServiceDefinition bindService() { * */ public static final class DocumentUnderstandingServiceStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractAsyncStub { private DocumentUnderstandingServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -291,11 +311,7 @@ public void processDocument( * */ public static final class DocumentUnderstandingServiceBlockingStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceBlockingStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractBlockingStub { private DocumentUnderstandingServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -344,11 +360,7 @@ public com.google.cloud.documentai.v1beta2.Document processDocument( * */ public static final class DocumentUnderstandingServiceFutureStub - extends io.grpc.stub.AbstractStub { - private DocumentUnderstandingServiceFutureStub(io.grpc.Channel channel) { - super(channel); - } - + extends io.grpc.stub.AbstractFutureStub { private DocumentUnderstandingServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); diff --git a/pom.xml b/pom.xml index 77e8248b..1a1e4173 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-document-ai-parent pom - 0.1.0 + 0.1.1 Google Cloud Document AI Parent https://github.com/googleapis/java-documentai @@ -64,14 +64,14 @@ github google-cloud-document-ai-parent 1.93.2 - 1.8.1 + 1.9.0 1.17.0 - 1.54.0 - 1.27.2 + 1.56.0 + 1.28.1 3.11.4 4.13 28.2-android - 1.4.1 + 1.4.3 1.3.2 1.18
@@ -81,22 +81,22 @@ com.google.api.grpc grpc-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 com.google.api.grpc grpc-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 com.google.api.grpc proto-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 com.google.api.grpc proto-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 diff --git a/proto-google-cloud-document-ai-v1beta1/pom.xml b/proto-google-cloud-document-ai-v1beta1/pom.xml index ebea3d6e..cded8555 100644 --- a/proto-google-cloud-document-ai-v1beta1/pom.xml +++ b/proto-google-cloud-document-ai-v1beta1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-document-ai-v1beta1 - 0.1.0 + 0.1.1 proto-google-cloud-document-ai-v1beta1 PROTO library for proto-google-cloud-document-ai-v1beta1 com.google.cloud google-cloud-document-ai-parent - 0.1.0 + 0.1.1 diff --git a/proto-google-cloud-document-ai-v1beta2/pom.xml b/proto-google-cloud-document-ai-v1beta2/pom.xml index bd30c9e9..78f6000c 100644 --- a/proto-google-cloud-document-ai-v1beta2/pom.xml +++ b/proto-google-cloud-document-ai-v1beta2/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-document-ai-v1beta2 - 0.1.0 + 0.1.1 proto-google-cloud-document-ai-v1beta2 PROTO library for proto-google-cloud-document-ai-v1beta2 com.google.cloud google-cloud-document-ai-parent - 0.1.0 + 0.1.1 diff --git a/renovate.json b/renovate.json index fc641270..a2c16888 100644 --- a/renovate.json +++ b/renovate.json @@ -56,7 +56,9 @@ }, { "packagePatterns": [ - "^com.google.cloud:libraries-bom" + "^com.google.cloud:google-cloud-document-ai", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" ], "semanticCommitType": "chore", "semanticCommitScope": "deps" @@ -75,4 +77,4 @@ } ], "semanticCommits": true -} +} \ No newline at end of file diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..40730740 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + documentai-install-without-bom + jar + Google Document AI Install Without Bom + https://github.com/googleapis/java-document-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-document-ai + 0.1.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..482ae29b --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-documentai-samples + 0.0.1-SNAPSHOT + pom + Google Document AI Samples Parent + https://github.com/googleapis/java-document-ai + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..2616b48d --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + documentai-snapshot + jar + Google Document AI Snapshot Samples + https://github.com/googleapis/java-document-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-document-ai + 0.1.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..5e720b7b --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + com.google.cloud + documentai-snippets + jar + Google Document AI Snippets + https://github.com/googleapis/java-document-ai + + + + com.google.cloud.samples + shared-configuration + 1.0.15 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 4.4.1 + pom + import + + + + + + + com.google.cloud + google-cloud-document-ai + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata index 53d9dd3f..f206c5e9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,28 +1,27 @@ { - "updateTime": "2020-03-14T08:52:09.900978Z", + "updateTime": "2020-04-06T23:26:05.388158Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8386761d09819b665b6a6e1e6d6ff884bc8ff781", - "internalRef": "300843960" + "sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d", + "internalRef": "304724866" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8386761d09819b665b6a6e1e6d6ff884bc8ff781", - "internalRef": "300843960", - "log": "8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\n" + "sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d", + "internalRef": "304724866" } }, { - "template": { - "name": "java_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8" } } ], diff --git a/synth.py b/synth.py index d971d29e..bf34fe02 100644 --- a/synth.py +++ b/synth.py @@ -16,6 +16,8 @@ import synthtool.languages.java as java +AUTOSYNTH_MULTIPLE_COMMITS = True + service = 'documentai' versions = ['v1beta1', 'v1beta2'] diff --git a/versions.txt b/versions.txt index 7adcfcb3..e1e7118b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ -proto-google-cloud-document-ai-v1beta1:0.1.0:0.1.0 -proto-google-cloud-document-ai-v1beta2:0.1.0:0.1.0 -grpc-google-cloud-document-ai-v1beta1:0.1.0:0.1.0 -grpc-google-cloud-document-ai-v1beta2:0.1.0:0.1.0 -google-cloud-document-ai:0.1.0:0.1.0 +proto-google-cloud-document-ai-v1beta1:0.1.1:0.1.1 +proto-google-cloud-document-ai-v1beta2:0.1.1:0.1.1 +grpc-google-cloud-document-ai-v1beta1:0.1.1:0.1.1 +grpc-google-cloud-document-ai-v1beta2:0.1.1:0.1.1 +google-cloud-document-ai:0.1.1:0.1.1