@@ -603,6 +603,180 @@ public final UnaryCallable<GetDocumentRequest, GetDocumentResponse> getDocumentC
603603 return stub .getDocumentCallable ();
604604 }
605605
606+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
607+ /**
608+ * Returns a list of documents present in the dataset.
609+ *
610+ * <p>Sample code:
611+ *
612+ * <pre>{@code
613+ * // This snippet has been automatically generated and should be regarded as a code template only.
614+ * // It will require modifications to work:
615+ * // - It may require correct/in-range values for request initialization.
616+ * // - It may require specifying regional endpoints when creating the service client as shown in
617+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
618+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
619+ * DatasetName dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
620+ * for (DocumentMetadata element : documentServiceClient.listDocuments(dataset).iterateAll()) {
621+ * // doThingsWith(element);
622+ * }
623+ * }
624+ * }</pre>
625+ *
626+ * @param dataset Required. The resource name of the dataset to be listed. Format:
627+ * projects/{project}/locations/{location}/processors/{processor}/dataset
628+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
629+ */
630+ public final ListDocumentsPagedResponse listDocuments (DatasetName dataset ) {
631+ ListDocumentsRequest request =
632+ ListDocumentsRequest .newBuilder ()
633+ .setDataset (dataset == null ? null : dataset .toString ())
634+ .build ();
635+ return listDocuments (request );
636+ }
637+
638+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
639+ /**
640+ * Returns a list of documents present in the dataset.
641+ *
642+ * <p>Sample code:
643+ *
644+ * <pre>{@code
645+ * // This snippet has been automatically generated and should be regarded as a code template only.
646+ * // It will require modifications to work:
647+ * // - It may require correct/in-range values for request initialization.
648+ * // - It may require specifying regional endpoints when creating the service client as shown in
649+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
650+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
651+ * String dataset = DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString();
652+ * for (DocumentMetadata element : documentServiceClient.listDocuments(dataset).iterateAll()) {
653+ * // doThingsWith(element);
654+ * }
655+ * }
656+ * }</pre>
657+ *
658+ * @param dataset Required. The resource name of the dataset to be listed. Format:
659+ * projects/{project}/locations/{location}/processors/{processor}/dataset
660+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
661+ */
662+ public final ListDocumentsPagedResponse listDocuments (String dataset ) {
663+ ListDocumentsRequest request = ListDocumentsRequest .newBuilder ().setDataset (dataset ).build ();
664+ return listDocuments (request );
665+ }
666+
667+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
668+ /**
669+ * Returns a list of documents present in the dataset.
670+ *
671+ * <p>Sample code:
672+ *
673+ * <pre>{@code
674+ * // This snippet has been automatically generated and should be regarded as a code template only.
675+ * // It will require modifications to work:
676+ * // - It may require correct/in-range values for request initialization.
677+ * // - It may require specifying regional endpoints when creating the service client as shown in
678+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
679+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
680+ * ListDocumentsRequest request =
681+ * ListDocumentsRequest.newBuilder()
682+ * .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
683+ * .setPageSize(883849137)
684+ * .setPageToken("pageToken873572522")
685+ * .setFilter("filter-1274492040")
686+ * .setReturnTotalSize(true)
687+ * .setSkip(3532159)
688+ * .build();
689+ * for (DocumentMetadata element : documentServiceClient.listDocuments(request).iterateAll()) {
690+ * // doThingsWith(element);
691+ * }
692+ * }
693+ * }</pre>
694+ *
695+ * @param request The request object containing all of the parameters for the API call.
696+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
697+ */
698+ public final ListDocumentsPagedResponse listDocuments (ListDocumentsRequest request ) {
699+ return listDocumentsPagedCallable ().call (request );
700+ }
701+
702+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
703+ /**
704+ * Returns a list of documents present in the dataset.
705+ *
706+ * <p>Sample code:
707+ *
708+ * <pre>{@code
709+ * // This snippet has been automatically generated and should be regarded as a code template only.
710+ * // It will require modifications to work:
711+ * // - It may require correct/in-range values for request initialization.
712+ * // - It may require specifying regional endpoints when creating the service client as shown in
713+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
714+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
715+ * ListDocumentsRequest request =
716+ * ListDocumentsRequest.newBuilder()
717+ * .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
718+ * .setPageSize(883849137)
719+ * .setPageToken("pageToken873572522")
720+ * .setFilter("filter-1274492040")
721+ * .setReturnTotalSize(true)
722+ * .setSkip(3532159)
723+ * .build();
724+ * ApiFuture<DocumentMetadata> future =
725+ * documentServiceClient.listDocumentsPagedCallable().futureCall(request);
726+ * // Do something.
727+ * for (DocumentMetadata element : future.get().iterateAll()) {
728+ * // doThingsWith(element);
729+ * }
730+ * }
731+ * }</pre>
732+ */
733+ public final UnaryCallable <ListDocumentsRequest , ListDocumentsPagedResponse >
734+ listDocumentsPagedCallable () {
735+ return stub .listDocumentsPagedCallable ();
736+ }
737+
738+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
739+ /**
740+ * Returns a list of documents present in the dataset.
741+ *
742+ * <p>Sample code:
743+ *
744+ * <pre>{@code
745+ * // This snippet has been automatically generated and should be regarded as a code template only.
746+ * // It will require modifications to work:
747+ * // - It may require correct/in-range values for request initialization.
748+ * // - It may require specifying regional endpoints when creating the service client as shown in
749+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
750+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
751+ * ListDocumentsRequest request =
752+ * ListDocumentsRequest.newBuilder()
753+ * .setDataset(DatasetName.of("[PROJECT]", "[LOCATION]", "[PROCESSOR]").toString())
754+ * .setPageSize(883849137)
755+ * .setPageToken("pageToken873572522")
756+ * .setFilter("filter-1274492040")
757+ * .setReturnTotalSize(true)
758+ * .setSkip(3532159)
759+ * .build();
760+ * while (true) {
761+ * ListDocumentsResponse response =
762+ * documentServiceClient.listDocumentsCallable().call(request);
763+ * for (DocumentMetadata element : response.getDocumentMetadataList()) {
764+ * // doThingsWith(element);
765+ * }
766+ * String nextPageToken = response.getNextPageToken();
767+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
768+ * request = request.toBuilder().setPageToken(nextPageToken).build();
769+ * } else {
770+ * break;
771+ * }
772+ * }
773+ * }
774+ * }</pre>
775+ */
776+ public final UnaryCallable <ListDocumentsRequest , ListDocumentsResponse > listDocumentsCallable () {
777+ return stub .listDocumentsCallable ();
778+ }
779+
606780 // AUTO-GENERATED DOCUMENTATION AND METHOD.
607781 /**
608782 * Deletes a set of documents.
@@ -1117,6 +1291,82 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
11171291 return stub .awaitTermination (duration , unit );
11181292 }
11191293
1294+ public static class ListDocumentsPagedResponse
1295+ extends AbstractPagedListResponse <
1296+ ListDocumentsRequest ,
1297+ ListDocumentsResponse ,
1298+ DocumentMetadata ,
1299+ ListDocumentsPage ,
1300+ ListDocumentsFixedSizeCollection > {
1301+
1302+ public static ApiFuture <ListDocumentsPagedResponse > createAsync (
1303+ PageContext <ListDocumentsRequest , ListDocumentsResponse , DocumentMetadata > context ,
1304+ ApiFuture <ListDocumentsResponse > futureResponse ) {
1305+ ApiFuture <ListDocumentsPage > futurePage =
1306+ ListDocumentsPage .createEmptyPage ().createPageAsync (context , futureResponse );
1307+ return ApiFutures .transform (
1308+ futurePage ,
1309+ input -> new ListDocumentsPagedResponse (input ),
1310+ MoreExecutors .directExecutor ());
1311+ }
1312+
1313+ private ListDocumentsPagedResponse (ListDocumentsPage page ) {
1314+ super (page , ListDocumentsFixedSizeCollection .createEmptyCollection ());
1315+ }
1316+ }
1317+
1318+ public static class ListDocumentsPage
1319+ extends AbstractPage <
1320+ ListDocumentsRequest , ListDocumentsResponse , DocumentMetadata , ListDocumentsPage > {
1321+
1322+ private ListDocumentsPage (
1323+ PageContext <ListDocumentsRequest , ListDocumentsResponse , DocumentMetadata > context ,
1324+ ListDocumentsResponse response ) {
1325+ super (context , response );
1326+ }
1327+
1328+ private static ListDocumentsPage createEmptyPage () {
1329+ return new ListDocumentsPage (null , null );
1330+ }
1331+
1332+ @ Override
1333+ protected ListDocumentsPage createPage (
1334+ PageContext <ListDocumentsRequest , ListDocumentsResponse , DocumentMetadata > context ,
1335+ ListDocumentsResponse response ) {
1336+ return new ListDocumentsPage (context , response );
1337+ }
1338+
1339+ @ Override
1340+ public ApiFuture <ListDocumentsPage > createPageAsync (
1341+ PageContext <ListDocumentsRequest , ListDocumentsResponse , DocumentMetadata > context ,
1342+ ApiFuture <ListDocumentsResponse > futureResponse ) {
1343+ return super .createPageAsync (context , futureResponse );
1344+ }
1345+ }
1346+
1347+ public static class ListDocumentsFixedSizeCollection
1348+ extends AbstractFixedSizeCollection <
1349+ ListDocumentsRequest ,
1350+ ListDocumentsResponse ,
1351+ DocumentMetadata ,
1352+ ListDocumentsPage ,
1353+ ListDocumentsFixedSizeCollection > {
1354+
1355+ private ListDocumentsFixedSizeCollection (List <ListDocumentsPage > pages , int collectionSize ) {
1356+ super (pages , collectionSize );
1357+ }
1358+
1359+ private static ListDocumentsFixedSizeCollection createEmptyCollection () {
1360+ return new ListDocumentsFixedSizeCollection (null , 0 );
1361+ }
1362+
1363+ @ Override
1364+ protected ListDocumentsFixedSizeCollection createCollection (
1365+ List <ListDocumentsPage > pages , int collectionSize ) {
1366+ return new ListDocumentsFixedSizeCollection (pages , collectionSize );
1367+ }
1368+ }
1369+
11201370 public static class ListLocationsPagedResponse
11211371 extends AbstractPagedListResponse <
11221372 ListLocationsRequest ,
0 commit comments