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

Commit f760842

Browse files
feat: add LEFT_CHEEK_CENTER and RIGHT_CHEEK_CENTER FaceAnnotation Landmark Types (#394)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/a39c5539-a594-4b12-9b6b-f4b118636e7f/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 356556588 Source-Link: googleapis/googleapis@9b95bf0 PiperOrigin-RevId: 356341083 Source-Link: googleapis/googleapis@8d8c008 docs: generate sample code in the Java microgenerator
1 parent 15e3220 commit f760842

35 files changed

+4225
-387
lines changed

google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
* <p>This class provides the ability to make remote calls to the backing service through method
4040
* calls that map to API methods. Sample code to get started:
4141
*
42+
* <pre>{@code
43+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
44+
* List<AnnotateImageRequest> requests = new ArrayList<>();
45+
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
46+
* }
47+
* }</pre>
48+
*
4249
* <p>Note: close() needs to be called on the ImageAnnotatorClient object to clean up resources such
4350
* as threads. In the example above, try-with-resources is used, which automatically calls close().
4451
*
@@ -153,6 +160,15 @@ public final OperationsClient getOperationsClient() {
153160
/**
154161
* Run image detection and annotation for a batch of images.
155162
*
163+
* <p>Sample code:
164+
*
165+
* <pre>{@code
166+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
167+
* List<AnnotateImageRequest> requests = new ArrayList<>();
168+
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(requests);
169+
* }
170+
* }</pre>
171+
*
156172
* @param requests Required. Individual image annotation requests for this batch.
157173
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
158174
*/
@@ -167,6 +183,19 @@ public final BatchAnnotateImagesResponse batchAnnotateImages(
167183
/**
168184
* Run image detection and annotation for a batch of images.
169185
*
186+
* <p>Sample code:
187+
*
188+
* <pre>{@code
189+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
190+
* BatchAnnotateImagesRequest request =
191+
* BatchAnnotateImagesRequest.newBuilder()
192+
* .addAllRequests(new ArrayList<AnnotateImageRequest>())
193+
* .setParent("parent-995424086")
194+
* .build();
195+
* BatchAnnotateImagesResponse response = imageAnnotatorClient.batchAnnotateImages(request);
196+
* }
197+
* }</pre>
198+
*
170199
* @param request The request object containing all of the parameters for the API call.
171200
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
172201
*/
@@ -179,6 +208,20 @@ public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImages
179208
* Run image detection and annotation for a batch of images.
180209
*
181210
* <p>Sample code:
211+
*
212+
* <pre>{@code
213+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
214+
* BatchAnnotateImagesRequest request =
215+
* BatchAnnotateImagesRequest.newBuilder()
216+
* .addAllRequests(new ArrayList<AnnotateImageRequest>())
217+
* .setParent("parent-995424086")
218+
* .build();
219+
* ApiFuture<BatchAnnotateImagesResponse> future =
220+
* imageAnnotatorClient.batchAnnotateImagesCallable().futureCall(request);
221+
* // Do something.
222+
* BatchAnnotateImagesResponse response = future.get();
223+
* }
224+
* }</pre>
182225
*/
183226
public final UnaryCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse>
184227
batchAnnotateImagesCallable() {
@@ -194,6 +237,15 @@ public final BatchAnnotateImagesResponse batchAnnotateImages(BatchAnnotateImages
194237
* AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and
195238
* perform detection and annotation for each image extracted.
196239
*
240+
* <p>Sample code:
241+
*
242+
* <pre>{@code
243+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
244+
* List<AnnotateFileRequest> requests = new ArrayList<>();
245+
* BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(requests);
246+
* }
247+
* }</pre>
248+
*
197249
* @param requests Required. The list of file annotation requests. Right now we support only one
198250
* AnnotateFileRequest in BatchAnnotateFilesRequest.
199251
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -213,6 +265,19 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(List<AnnotateFileRequ
213265
* AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and
214266
* perform detection and annotation for each image extracted.
215267
*
268+
* <p>Sample code:
269+
*
270+
* <pre>{@code
271+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
272+
* BatchAnnotateFilesRequest request =
273+
* BatchAnnotateFilesRequest.newBuilder()
274+
* .addAllRequests(new ArrayList<AnnotateFileRequest>())
275+
* .setParent("parent-995424086")
276+
* .build();
277+
* BatchAnnotateFilesResponse response = imageAnnotatorClient.batchAnnotateFiles(request);
278+
* }
279+
* }</pre>
280+
*
216281
* @param request The request object containing all of the parameters for the API call.
217282
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
218283
*/
@@ -230,6 +295,20 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
230295
* perform detection and annotation for each image extracted.
231296
*
232297
* <p>Sample code:
298+
*
299+
* <pre>{@code
300+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
301+
* BatchAnnotateFilesRequest request =
302+
* BatchAnnotateFilesRequest.newBuilder()
303+
* .addAllRequests(new ArrayList<AnnotateFileRequest>())
304+
* .setParent("parent-995424086")
305+
* .build();
306+
* ApiFuture<BatchAnnotateFilesResponse> future =
307+
* imageAnnotatorClient.batchAnnotateFilesCallable().futureCall(request);
308+
* // Do something.
309+
* BatchAnnotateFilesResponse response = future.get();
310+
* }
311+
* }</pre>
233312
*/
234313
public final UnaryCallable<BatchAnnotateFilesRequest, BatchAnnotateFilesResponse>
235314
batchAnnotateFilesCallable() {
@@ -247,6 +326,17 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
247326
* <p>This service will write image annotation outputs to json files in customer GCS bucket, each
248327
* json file containing BatchAnnotateImagesResponse proto.
249328
*
329+
* <p>Sample code:
330+
*
331+
* <pre>{@code
332+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
333+
* List<AnnotateImageRequest> requests = new ArrayList<>();
334+
* OutputConfig outputConfig = OutputConfig.newBuilder().build();
335+
* AsyncBatchAnnotateImagesResponse response =
336+
* imageAnnotatorClient.asyncBatchAnnotateImagesAsync(requests, outputConfig).get();
337+
* }
338+
* }</pre>
339+
*
250340
* @param requests Required. Individual image annotation requests for this batch.
251341
* @param outputConfig Required. The desired output location and metadata (e.g. format).
252342
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -273,6 +363,21 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
273363
* <p>This service will write image annotation outputs to json files in customer GCS bucket, each
274364
* json file containing BatchAnnotateImagesResponse proto.
275365
*
366+
* <p>Sample code:
367+
*
368+
* <pre>{@code
369+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
370+
* AsyncBatchAnnotateImagesRequest request =
371+
* AsyncBatchAnnotateImagesRequest.newBuilder()
372+
* .addAllRequests(new ArrayList<AnnotateImageRequest>())
373+
* .setOutputConfig(OutputConfig.newBuilder().build())
374+
* .setParent("parent-995424086")
375+
* .build();
376+
* AsyncBatchAnnotateImagesResponse response =
377+
* imageAnnotatorClient.asyncBatchAnnotateImagesAsync(request).get();
378+
* }
379+
* }</pre>
380+
*
276381
* @param request The request object containing all of the parameters for the API call.
277382
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
278383
*/
@@ -293,6 +398,21 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
293398
* json file containing BatchAnnotateImagesResponse proto.
294399
*
295400
* <p>Sample code:
401+
*
402+
* <pre>{@code
403+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
404+
* AsyncBatchAnnotateImagesRequest request =
405+
* AsyncBatchAnnotateImagesRequest.newBuilder()
406+
* .addAllRequests(new ArrayList<AnnotateImageRequest>())
407+
* .setOutputConfig(OutputConfig.newBuilder().build())
408+
* .setParent("parent-995424086")
409+
* .build();
410+
* OperationFuture<AsyncBatchAnnotateImagesResponse, OperationMetadata> future =
411+
* imageAnnotatorClient.asyncBatchAnnotateImagesOperationCallable().futureCall(request);
412+
* // Do something.
413+
* AsyncBatchAnnotateImagesResponse response = future.get();
414+
* }
415+
* }</pre>
296416
*/
297417
public final OperationCallable<
298418
AsyncBatchAnnotateImagesRequest, AsyncBatchAnnotateImagesResponse, OperationMetadata>
@@ -312,6 +432,21 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
312432
* json file containing BatchAnnotateImagesResponse proto.
313433
*
314434
* <p>Sample code:
435+
*
436+
* <pre>{@code
437+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
438+
* AsyncBatchAnnotateImagesRequest request =
439+
* AsyncBatchAnnotateImagesRequest.newBuilder()
440+
* .addAllRequests(new ArrayList<AnnotateImageRequest>())
441+
* .setOutputConfig(OutputConfig.newBuilder().build())
442+
* .setParent("parent-995424086")
443+
* .build();
444+
* ApiFuture<Operation> future =
445+
* imageAnnotatorClient.asyncBatchAnnotateImagesCallable().futureCall(request);
446+
* // Do something.
447+
* Operation response = future.get();
448+
* }
449+
* }</pre>
315450
*/
316451
public final UnaryCallable<AsyncBatchAnnotateImagesRequest, Operation>
317452
asyncBatchAnnotateImagesCallable() {
@@ -326,6 +461,16 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
326461
* `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
327462
* (results).
328463
*
464+
* <p>Sample code:
465+
*
466+
* <pre>{@code
467+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
468+
* List<AsyncAnnotateFileRequest> requests = new ArrayList<>();
469+
* AsyncBatchAnnotateFilesResponse response =
470+
* imageAnnotatorClient.asyncBatchAnnotateFilesAsync(requests).get();
471+
* }
472+
* }</pre>
473+
*
329474
* @param requests Required. Individual async file annotation requests for this batch.
330475
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
331476
*/
@@ -344,6 +489,20 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
344489
* `OperationMetadata` (metadata). `Operation.response` contains `AsyncBatchAnnotateFilesResponse`
345490
* (results).
346491
*
492+
* <p>Sample code:
493+
*
494+
* <pre>{@code
495+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
496+
* AsyncBatchAnnotateFilesRequest request =
497+
* AsyncBatchAnnotateFilesRequest.newBuilder()
498+
* .addAllRequests(new ArrayList<AsyncAnnotateFileRequest>())
499+
* .setParent("parent-995424086")
500+
* .build();
501+
* AsyncBatchAnnotateFilesResponse response =
502+
* imageAnnotatorClient.asyncBatchAnnotateFilesAsync(request).get();
503+
* }
504+
* }</pre>
505+
*
347506
* @param request The request object containing all of the parameters for the API call.
348507
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
349508
*/
@@ -361,6 +520,20 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
361520
* (results).
362521
*
363522
* <p>Sample code:
523+
*
524+
* <pre>{@code
525+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
526+
* AsyncBatchAnnotateFilesRequest request =
527+
* AsyncBatchAnnotateFilesRequest.newBuilder()
528+
* .addAllRequests(new ArrayList<AsyncAnnotateFileRequest>())
529+
* .setParent("parent-995424086")
530+
* .build();
531+
* OperationFuture<AsyncBatchAnnotateFilesResponse, OperationMetadata> future =
532+
* imageAnnotatorClient.asyncBatchAnnotateFilesOperationCallable().futureCall(request);
533+
* // Do something.
534+
* AsyncBatchAnnotateFilesResponse response = future.get();
535+
* }
536+
* }</pre>
364537
*/
365538
public final OperationCallable<
366539
AsyncBatchAnnotateFilesRequest, AsyncBatchAnnotateFilesResponse, OperationMetadata>
@@ -377,6 +550,20 @@ public final BatchAnnotateFilesResponse batchAnnotateFiles(BatchAnnotateFilesReq
377550
* (results).
378551
*
379552
* <p>Sample code:
553+
*
554+
* <pre>{@code
555+
* try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient.create()) {
556+
* AsyncBatchAnnotateFilesRequest request =
557+
* AsyncBatchAnnotateFilesRequest.newBuilder()
558+
* .addAllRequests(new ArrayList<AsyncAnnotateFileRequest>())
559+
* .setParent("parent-995424086")
560+
* .build();
561+
* ApiFuture<Operation> future =
562+
* imageAnnotatorClient.asyncBatchAnnotateFilesCallable().futureCall(request);
563+
* // Do something.
564+
* Operation response = future.get();
565+
* }
566+
* }</pre>
380567
*/
381568
public final UnaryCallable<AsyncBatchAnnotateFilesRequest, Operation>
382569
asyncBatchAnnotateFilesCallable() {

0 commit comments

Comments
 (0)