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

Commit 2f41680

Browse files
chore: migrate to microgenerator (#294)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/ff784592-64c9-46c3-9496-790383c9f6ca/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 346372957 Source-Link: googleapis/googleapis@857f70d PiperOrigin-RevId: 346126713 Source-Link: googleapis/googleapis@b8b2f8c PiperOrigin-RevId: 345493384 Source-Link: googleapis/googleapis@8677c18
1 parent fb2e9af commit 2f41680

File tree

33 files changed

+805
-1025
lines changed

33 files changed

+805
-1025
lines changed

google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceClient.java

Lines changed: 17 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.google.cloud.documentai.v1beta1;
1718

1819
import com.google.api.core.BetaApi;
@@ -29,7 +30,7 @@
2930
import java.util.concurrent.TimeUnit;
3031
import javax.annotation.Generated;
3132

32-
// AUTO-GENERATED DOCUMENTATION AND SERVICE
33+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
3334
/**
3435
* Service Description: Service to parse structured information from unstructured or semi-structured
3536
* documents using state-of-the-art Google AI such as natural language, computer vision, and
@@ -38,16 +39,7 @@
3839
* <p>This class provides the ability to make remote calls to the backing service through method
3940
* calls that map to API methods. Sample code to get started:
4041
*
41-
* <pre>
42-
* <code>
43-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
44-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
45-
* BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
46-
* }
47-
* </code>
48-
* </pre>
49-
*
50-
* <p>Note: close() needs to be called on the documentUnderstandingServiceClient object to clean up
42+
* <p>Note: close() needs to be called on the DocumentUnderstandingServiceClient object to clean up
5143
* resources such as threads. In the example above, try-with-resources is used, which automatically
5244
* calls close().
5345
*
@@ -76,30 +68,28 @@
7668
*
7769
* <p>To customize credentials:
7870
*
79-
* <pre>
80-
* <code>
71+
* <pre>{@code
8172
* DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
8273
* DocumentUnderstandingServiceSettings.newBuilder()
8374
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
8475
* .build();
8576
* DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
8677
* DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
87-
* </code>
88-
* </pre>
78+
* }</pre>
8979
*
90-
* To customize the endpoint:
80+
* <p>To customize the endpoint:
9181
*
92-
* <pre>
93-
* <code>
82+
* <pre>{@code
9483
* DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
9584
* DocumentUnderstandingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
9685
* DocumentUnderstandingServiceClient documentUnderstandingServiceClient =
9786
* DocumentUnderstandingServiceClient.create(documentUnderstandingServiceSettings);
98-
* </code>
99-
* </pre>
87+
* }</pre>
88+
*
89+
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
10090
*/
101-
@Generated("by gapic-generator")
10291
@BetaApi
92+
@Generated("by gapic-generator")
10393
public class DocumentUnderstandingServiceClient implements BackgroundResource {
10494
private final DocumentUnderstandingServiceSettings settings;
10595
private final DocumentUnderstandingServiceStub stub;
@@ -122,7 +112,7 @@ public static final DocumentUnderstandingServiceClient create(
122112

123113
/**
124114
* Constructs an instance of DocumentUnderstandingServiceClient, using the given stub for making
125-
* calls. This is for advanced usage - prefer to use DocumentUnderstandingServiceSettings}.
115+
* calls. This is for advanced usage - prefer using create(DocumentUnderstandingServiceSettings).
126116
*/
127117
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
128118
public static final DocumentUnderstandingServiceClient create(
@@ -163,105 +153,53 @@ public DocumentUnderstandingServiceStub getStub() {
163153
* Returns the OperationsClient that can be used to query the status of a long-running operation
164154
* returned by another API method call.
165155
*/
166-
@BetaApi(
167-
"The surface for long-running operations is not stable yet and may change in the future.")
168156
public final OperationsClient getOperationsClient() {
169157
return operationsClient;
170158
}
171159

172-
// AUTO-GENERATED DOCUMENTATION AND METHOD
160+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
173161
/**
174162
* LRO endpoint to batch process many documents.
175163
*
176-
* <p>Sample code:
177-
*
178-
* <pre><code>
179-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
180-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
181-
* BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests).get();
182-
* }
183-
* </code></pre>
184-
*
185164
* @param requests Required. Individual requests for each document.
186165
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
187166
*/
188-
@BetaApi(
189-
"The surface for long-running operations is not stable yet and may change in the future.")
190167
public final OperationFuture<BatchProcessDocumentsResponse, OperationMetadata>
191168
batchProcessDocumentsAsync(List<ProcessDocumentRequest> requests) {
192169
BatchProcessDocumentsRequest request =
193170
BatchProcessDocumentsRequest.newBuilder().addAllRequests(requests).build();
194171
return batchProcessDocumentsAsync(request);
195172
}
196173

197-
// AUTO-GENERATED DOCUMENTATION AND METHOD
174+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
198175
/**
199176
* LRO endpoint to batch process many documents.
200177
*
201-
* <p>Sample code:
202-
*
203-
* <pre><code>
204-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
205-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
206-
* BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
207-
* .addAllRequests(requests)
208-
* .build();
209-
* BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(request).get();
210-
* }
211-
* </code></pre>
212-
*
213178
* @param request The request object containing all of the parameters for the API call.
214179
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
215180
*/
216-
@BetaApi(
217-
"The surface for long-running operations is not stable yet and may change in the future.")
218181
public final OperationFuture<BatchProcessDocumentsResponse, OperationMetadata>
219182
batchProcessDocumentsAsync(BatchProcessDocumentsRequest request) {
220183
return batchProcessDocumentsOperationCallable().futureCall(request);
221184
}
222185

223-
// AUTO-GENERATED DOCUMENTATION AND METHOD
186+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
224187
/**
225188
* LRO endpoint to batch process many documents.
226189
*
227190
* <p>Sample code:
228-
*
229-
* <pre><code>
230-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
231-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
232-
* BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
233-
* .addAllRequests(requests)
234-
* .build();
235-
* OperationFuture&lt;BatchProcessDocumentsResponse, OperationMetadata&gt; future = documentUnderstandingServiceClient.batchProcessDocumentsOperationCallable().futureCall(request);
236-
* // Do something
237-
* BatchProcessDocumentsResponse response = future.get();
238-
* }
239-
* </code></pre>
240191
*/
241-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
242192
public final OperationCallable<
243193
BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata>
244194
batchProcessDocumentsOperationCallable() {
245195
return stub.batchProcessDocumentsOperationCallable();
246196
}
247197

248-
// AUTO-GENERATED DOCUMENTATION AND METHOD
198+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
249199
/**
250200
* LRO endpoint to batch process many documents.
251201
*
252202
* <p>Sample code:
253-
*
254-
* <pre><code>
255-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
256-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
257-
* BatchProcessDocumentsRequest request = BatchProcessDocumentsRequest.newBuilder()
258-
* .addAllRequests(requests)
259-
* .build();
260-
* ApiFuture&lt;Operation&gt; future = documentUnderstandingServiceClient.batchProcessDocumentsCallable().futureCall(request);
261-
* // Do something
262-
* Operation response = future.get();
263-
* }
264-
* </code></pre>
265203
*/
266204
public final UnaryCallable<BatchProcessDocumentsRequest, Operation>
267205
batchProcessDocumentsCallable() {

google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/DocumentUnderstandingServiceSettings.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.google.cloud.documentai.v1beta1;
1718

1819
import com.google.api.core.ApiFunction;
@@ -32,7 +33,7 @@
3233
import java.util.List;
3334
import javax.annotation.Generated;
3435

35-
// AUTO-GENERATED DOCUMENTATION AND CLASS
36+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
3637
/**
3738
* Settings class to configure an instance of {@link DocumentUnderstandingServiceClient}.
3839
*
@@ -47,26 +48,28 @@
4748
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
4849
* build() is called, the tree of builders is called to create the complete settings object.
4950
*
50-
* <p>For example, to set the total timeout of batchProcessDocumentsAsync to 30 seconds:
51+
* <p>For example, to set the total timeout of batchProcessDocuments to 30 seconds:
5152
*
52-
* <pre>
53-
* <code>
53+
* <pre>{@code
5454
* DocumentUnderstandingServiceSettings.Builder documentUnderstandingServiceSettingsBuilder =
5555
* DocumentUnderstandingServiceSettings.newBuilder();
5656
* documentUnderstandingServiceSettingsBuilder
5757
* .batchProcessDocumentsSettings()
5858
* .setRetrySettings(
59-
* documentUnderstandingServiceSettingsBuilder.batchProcessDocumentsSettings().getRetrySettings().toBuilder()
59+
* documentUnderstandingServiceSettingsBuilder
60+
* .batchProcessDocumentsSettings()
61+
* .getRetrySettings()
62+
* .toBuilder()
6063
* .setTotalTimeout(Duration.ofSeconds(30))
6164
* .build());
62-
* DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings = documentUnderstandingServiceSettingsBuilder.build();
63-
* </code>
64-
* </pre>
65+
* DocumentUnderstandingServiceSettings documentUnderstandingServiceSettings =
66+
* documentUnderstandingServiceSettingsBuilder.build();
67+
* }</pre>
6568
*/
66-
@Generated("by gapic-generator")
67-
@BetaApi
69+
@Generated("by gapic-generator-java")
6870
public class DocumentUnderstandingServiceSettings
6971
extends ClientSettings<DocumentUnderstandingServiceSettings> {
72+
7073
/** Returns the object with the settings used for calls to batchProcessDocuments. */
7174
public UnaryCallSettings<BatchProcessDocumentsRequest, Operation>
7275
batchProcessDocumentsSettings() {
@@ -75,8 +78,6 @@ public class DocumentUnderstandingServiceSettings
7578
}
7679

7780
/** Returns the object with the settings used for calls to batchProcessDocuments. */
78-
@BetaApi(
79-
"The surface for long-running operations is not stable yet and may change in the future.")
8081
public OperationCallSettings<
8182
BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata>
8283
batchProcessDocumentsOperationSettings() {
@@ -145,18 +146,15 @@ protected DocumentUnderstandingServiceSettings(Builder settingsBuilder) throws I
145146
/** Builder for DocumentUnderstandingServiceSettings. */
146147
public static class Builder
147148
extends ClientSettings.Builder<DocumentUnderstandingServiceSettings, Builder> {
149+
148150
protected Builder() throws IOException {
149-
this((ClientContext) null);
151+
this(((ClientContext) null));
150152
}
151153

152154
protected Builder(ClientContext clientContext) {
153155
super(DocumentUnderstandingServiceStubSettings.newBuilder(clientContext));
154156
}
155157

156-
private static Builder createDefault() {
157-
return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder());
158-
}
159-
160158
protected Builder(DocumentUnderstandingServiceSettings settings) {
161159
super(settings.getStubSettings().toBuilder());
162160
}
@@ -165,11 +163,15 @@ protected Builder(DocumentUnderstandingServiceStubSettings.Builder stubSettings)
165163
super(stubSettings);
166164
}
167165

166+
private static Builder createDefault() {
167+
return new Builder(DocumentUnderstandingServiceStubSettings.newBuilder());
168+
}
169+
168170
public DocumentUnderstandingServiceStubSettings.Builder getStubSettingsBuilder() {
169171
return ((DocumentUnderstandingServiceStubSettings.Builder) getStubSettings());
170172
}
171173

172-
// NEXT_MAJOR_VER: remove 'throws Exception'
174+
// NEXT_MAJOR_VER: remove 'throws Exception'.
173175
/**
174176
* Applies the given settings updater function to all of the unary API methods in this service.
175177
*
@@ -189,8 +191,6 @@ public Builder applyToAllUnaryMethods(
189191
}
190192

191193
/** Returns the builder for the settings used for calls to batchProcessDocuments. */
192-
@BetaApi(
193-
"The surface for long-running operations is not stable yet and may change in the future.")
194194
public OperationCallSettings.Builder<
195195
BatchProcessDocumentsRequest, BatchProcessDocumentsResponse, OperationMetadata>
196196
batchProcessDocumentsOperationSettings() {

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,29 +15,17 @@
1515
*/
1616

1717
/**
18-
* A client to Cloud Document AI API.
18+
* The interfaces provided are listed below, along with usage samples.
1919
*
20-
* <p>The interfaces provided are listed below, along with usage samples.
21-
*
22-
* <p>================================== DocumentUnderstandingServiceClient
23-
* ==================================
20+
* <p>======================= DocumentUnderstandingServiceClient =======================
2421
*
2522
* <p>Service Description: Service to parse structured information from unstructured or
2623
* semi-structured documents using state-of-the-art Google AI such as natural language, computer
2724
* vision, and translation.
2825
*
2926
* <p>Sample for DocumentUnderstandingServiceClient:
30-
*
31-
* <pre>
32-
* <code>
33-
* try (DocumentUnderstandingServiceClient documentUnderstandingServiceClient = DocumentUnderstandingServiceClient.create()) {
34-
* List&lt;ProcessDocumentRequest&gt; requests = new ArrayList&lt;&gt;();
35-
* BatchProcessDocumentsResponse response = documentUnderstandingServiceClient.batchProcessDocumentsAsync(requests);
36-
* }
37-
* </code>
38-
* </pre>
3927
*/
40-
@Generated("by gapic-generator")
28+
@Generated("by gapic-generator-java")
4129
package com.google.cloud.documentai.v1beta1;
4230

4331
import javax.annotation.Generated;

0 commit comments

Comments
 (0)