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

Commit

Permalink
fix(v1beta2): set default endpoint to us-documentai.googleapis.com (#44)
Browse files Browse the repository at this point in the history
googleapis/googleapis@d6cb499
commit d6cb4997910eda04c0c66c0f2fd043eeaa0f660d
Author: Google APIs <noreply@google.com>
Date:   Fri Apr 3 17:33:05 2020 -0700

    chore: enable gapic v2 and proto annotation for documentai API.

    committer @summer-ji-eng

    PiperOrigin-RevId: 304724866
  • Loading branch information
yoshi-automation committed Apr 6, 2020
1 parent ec57073 commit 1b928a1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 17 deletions.
Expand Up @@ -41,7 +41,10 @@
* <pre>
* <code>
* 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);
* }
* </code>
Expand Down Expand Up @@ -280,7 +283,10 @@ public final OperationsClient getOperationsClient() {
*
* <pre><code>
* 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);
* }
* </code></pre>
Expand All @@ -300,7 +306,10 @@ public final Document processDocument(ProcessDocumentRequest request) {
*
* <pre><code>
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
* ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder().build();
* InputConfig inputConfig = InputConfig.newBuilder().build();
* ProcessDocumentRequest request = ProcessDocumentRequest.newBuilder()
* .setInputConfig(inputConfig)
* .build();
* ApiFuture&lt;Document&gt; future = documentUnderstandingServiceClient.processDocumentCallable().futureCall(request);
* // Do something
* Document response = future.get();
Expand Down
Expand Up @@ -39,7 +39,7 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (documentai.googleapis.com) and default port (443) are used.
* <li>The default service address (us-documentai.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Expand Up @@ -31,7 +31,10 @@
* <pre>
* <code>
* 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);
* }
* </code>
Expand Down
Expand Up @@ -56,7 +56,7 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (documentai.googleapis.com) and default port (443) are used.
* <li>The default service address (us-documentai.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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);
Expand All @@ -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(),
Expand All @@ -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");
Expand Down
11 changes: 6 additions & 5 deletions synth.metadata
@@ -1,20 +1,21 @@
{
"updateTime": "2020-04-01T22:50:06.763039Z",
"updateTime": "2020-04-04T08:59:05.982066Z",
"sources": [
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679",
"internalRef": "302913609"
"sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d",
"internalRef": "304724866"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679",
"internalRef": "302913609"
"sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d",
"internalRef": "304724866",
"log": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n3d5d228a58bdf875e6147b228db3159010c735ee\nEnable visibility on the GetSnapshot and GetTopicSnapshots methods\n\nPiperOrigin-RevId: 304500143\n\n1346f5c11a0376bc82c5c03259b304de52671518\nRefresh public client library for Cloud Monitoring.\nIncrease default ListTimeSeries deadline to 90s.\n\nPiperOrigin-RevId: 304467075\n\n4a6cfccb4a32cb28db7366295d90078c6af3112f\ndocs: Fix link in monitoring summary description.\n\nPiperOrigin-RevId: 304438717\n\n6e2ea9a4b63a264090f1bd4b5b25766a3f634f3a\nfix: add interface name overrides back to logging gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304438432\n\n01f3ccbaa66cf3ae4e3b9fd140b1ecfbe54a3ed0\nFix: Add package/namespace options for C#, Ruby and PHP in remaining protos.\n\nPiperOrigin-RevId: 304416658\n\nb89abbf12cd3c086abddcd79adb0a653349f960a\nchore(google/maps): Rename nox.py to noxfile.py\n\nupstream wip fix here: https://github.com/googleapis/gapic-generator/pull/3156\n\nPiperOrigin-RevId: 304411146\n\nbbf26d7f11fae7789b13959bf100983c496c9807\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 304409906\n\n75047719f704d61f405cac6d7439637ab36c1232\nfix Dataproc: add missing `REQUIRED` annotation.\n\nPiperOrigin-RevId: 304305096\n\n7e1b880fd5d477176cf9b0bb9b137b9bea56e787\nAdd Ruby/PHP namespace options\n\nPiperOrigin-RevId: 304288402\n\naba342359b6743353195ca53f944fe71e6fb6cd4\nchore: add java assembly target for accesscontextmanager BUILD.bazel\n\nPiperOrigin-RevId: 304207684\n\ndc65f39f33cb139b3a2244199a3e722a4d94b679\nFor Secret Manager v1 and v1beta1, noted Secret ID character limitations.\n\nPiperOrigin-RevId: 304035052\n\n2ee8c4d06db823c29a127709e66c35e38b6e98ab\nchore(deps): Update gax-java dependency\nThis is to integrate java11 incompatibility fix\n\nPiperOrigin-RevId: 304032057\n\nb5c94cec71ea9b840dc0110a0275323313ecc85a\nchore: add java assembly target for orgpolicy BUILD.bazel\n\nPiperOrigin-RevId: 304021854\n\n690f4d6344197fde775230cec165a9db3b3929c7\nchore: use the latest protoc-java-resource-name-plugin in third_party/googleapis WORKSPACE.\n- trace up only one level when calculating parent types with singleton resource names\n\nPiperOrigin-RevId: 304007414\n\n87144228bd9920b824996355f27891310fad5a32\nEnable gapic v2 for DLP.\n\nCommitter: @hzyi-google\nPiperOrigin-RevId: 303999064\n\n17cfae00f2bb51cb1683f017da7e295a1b0f01a8\nAdd a new AuthorizationType for Data Source Definition.\n\nPiperOrigin-RevId: 303992863\n\n6da3d64919c006ef40cad2026f1e39084253afe2\nfix(google/maps): Change importpath to developers.google.com/maps/go.\n\nPiperOrigin-RevId: 303976942\n\n2983dccde54f0ce31793e1e628379616c468aea0\nbuild(google/maps): only modify root build.gradle with ext plugin\n\nPiperOrigin-RevId: 303975876\n\n00f0a285f2716ce57e98afe500e450b17b556ff8\nfix: Integerate gapic-generator java_gapic rules Java11 fix\n\nPiperOrigin-RevId: 303899179\n\na62857d26bd2ae15aec13a9244989e4104195b63\nfix: add proto_package to the artman config of dataproc v1beta2 to make artman smoketest pass.\n\nPiperOrigin-RevId: 303853989\n\nf260ba248df934fd4ddc22950fb529a59d79e0b5\nchore: use the latest gapic-generator in googleapis WORKSPACE.\n- PHP multi-pattern resource name support.\n- Trace up only one level when calculating parent types with singleton resource names\n\nPiperOrigin-RevId: 303836059\n\n89c7d455fffa5d8a7e73c2f4da43a74605ed72a6\nfeat: Add client library options to OsConfigService v1 patch APIs.\n\nPiperOrigin-RevId: 303831150\n\na45b0a2a8f6f497547ab531a4da978c76441d076\ndataproc: add back non-default retry parameters.\ncommitter: @hzyi-google\n\nPiperOrigin-RevId: 303830177\n\nad895ce95f1f6d2261fbbc3e8897958294e4f017\nenable gapic v2 for containeranalysis.\ncommitter: @hzyi-google\n\nPiperOrigin-RevId: 303821111\n\nbaf83e521834b67397839bcbe2d7864b49e38787\nAdding \"resource_reference\" annotations to services.\n\nPiperOrigin-RevId: 303791704\n\n7be2811ad17013a5ea24cd75dfd9e399dd6e18fe\nfix: Update gapic-generator version to pickup discogapic fixes\n\nPiperOrigin-RevId: 303545940\n\nb655808b3481a92f478ae2f828a6ce8220e40f32\ncloudasset: add org policy and access context manager protos to client libraries.\n\nPiperOrigin-RevId: 303527638\n\nd8c5da9a9471659b51d5862dd2ea7ad3c4bc49ef\nPopulate BAZEL.build files for AccessContextManager.\n\nPiperOrigin-RevId: 303526825\n\ncf9db7161cb9d4dbef06cd8bf5354ec485e51e2d\nPopulate BAZEL.build files for OrgPolicy.\n\nPiperOrigin-RevId: 303526702\n\n558b800ed594acc02555cc560fbb39c0e42bc438\nchore: turn on gapic v2 for Dataproc API.\nfix:\n- add missing method signatures\n- remove resource_reference not on a string field\n- adjust resource name pattern orders\n\nPiperOrigin-RevId: 303431167\n\n8eb444cf5ff63f68d826acbb37b2ac3da58655fb\nAdd logging protos for Recommender v1beta1.\n\nPiperOrigin-RevId: 303426030\n\n48a166ce9f6e2a88b10947341b37336fe9dd3478\nPush of PHP, C# and Ruby namespaces\n\nPiperOrigin-RevId: 303302813\n\n42f77489b300df2e27c84a7b65c4e8f04da20981\nThis is first release of the API protos and Bazel BUILD files for the Analytics Management API V1alpha.\n\nPiperOrigin-RevId: 303241805\n\n8bea81bfa461698981b3d3a488a95633d2f6e9ff\nchore: use latest protoc-java-resource-name-plugin in bazel WORKSPACE.\nnew commits:\n- fix: stop generating `parseList` and `toStringList` if a multi-pattern resource name has subclasses (#79)\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 303197602\n\nb14af92e565264675d6b12cd2c0ded6c94ddd7f8\nfix talent API incorrect placeholders in two resource name patterns.\ncommitter: @hzyi-google\n\nPiperOrigin-RevId: 303189497\n\n8e22db908ae09e1f7e2802c03b4563fd6b524e0e\nchore(google/maps): Update postprocessing script for Java.\n\n- Update root build.gradle to load local plugin\n- Change com.google.api.grpc group to com.google.maps\n\nPiperOrigin-RevId: 303176850\n\n65816afa71e588252b7119dc723592abe51ea106\nbazel: update gapic-generator-go to v0.12.5 and gapic-generator hash\n\nChanges to gapic-generator-go include:\n* feat: strip invalid link references in comments\n* chore: updating Go deps in bazel repositories\n\nChanges to gapic-generator include:\n* fix: bazel go build gen check for cloud in proto pkg name\n* Revert \"feat: allow static substitution for group name\"\n\nPiperOrigin-RevId: 303150338\n\nd4aa417ed2bba89c2d216900282bddfdafef6128\nFix incorrect retry config in gapic v2 for kms.\n\nPiperOrigin-RevId: 303010132\n\nfd08334533204fdd1b33f79fcb263dbb5bf13de0\nfix: osconfig/v1 update go_gapic_library target to microgen interface\n\nPiperOrigin-RevId: 303007866\n\ne2c0f2a0e06d86b50aba98f67f9f291587d986b3\nUpdate comments for google/rpc/error_details.proto.\n\nPiperOrigin-RevId: 303002528\n\nf786c7586748e78a286b1620ff3ddbf7b4dcab92\nfeat: Add OsConfigService v1 patch APIs.\n\nPiperOrigin-RevId: 302999346\n\n0341fa3fc2f4073a1b1f260d37b2ce620799f545\nTurn on gapic config v2 for kms.\n\nCommitter: @hzyi-google\nPiperOrigin-RevId: 302980301\n\n32dc6e832039b61ac3fb82c72eb0a27570aebcd6\nredis: v1beta1 enables REDIS_5_0 as an option for redis_version field and adds two new redis configs --stream-node-max-entries --stream-node-max-bytes\n\nPiperOrigin-RevId: 302958009\n\n685f16483cc4d87c35051f21f8f13ef4fdc919b4\nredis: v1 enables REDIS_5_0 as an option for redis_version field and adds two new redis configs --stream-node-max-entries --stream-node-max-bytes\n\nPiperOrigin-RevId: 302957729\n\n733cb282ae5e64673ef86c9a5dff647df803d8b7\nAdd GAPIC cofiguration for v1 client library genetration.\n\nPiperOrigin-RevId: 302928200\n\n1b0fff5f2ec6dc4a9443d9b50e70e9c94c30c45b\ndocs: remove an internal lint declaration\n\nPiperOrigin-RevId: 302928106\n\n2be23f3f3036a6f7ce0844def3d2d3da74e5d415\nfix(google/maps): Add post-processing rules for Google Maps APIs\n\nPiperOrigin-RevId: 302925222\n\n"
}
},
{
Expand Down

0 comments on commit 1b928a1

Please sign in to comment.