use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncGetShelfShelfname method syncGetShelfShelfname.
public static void syncGetShelfShelfname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ShelfName name = ShelfName.of("[SHELF_ID]");
Shelf response = libraryServiceClient.getShelf(name);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncGetShelfString method syncGetShelfString.
public static void syncGetShelfString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = ShelfName.of("[SHELF_ID]").toString();
Shelf response = libraryServiceClient.getShelf(name);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class AsyncListBooks method asyncListBooks.
public static void asyncListBooks() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ListBooksRequest request = ListBooksRequest.newBuilder().setParent(ShelfName.of("[SHELF_ID]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
ApiFuture<Book> future = libraryServiceClient.listBooksPagedCallable().futureCall(request);
// Do something.
for (Book element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMergeShelvesShelfnameString method syncMergeShelvesShelfnameString.
public static void syncMergeShelvesShelfnameString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ShelfName name = ShelfName.of("[SHELF_ID]");
String otherShelf = ShelfName.of("[SHELF_ID]").toString();
Shelf response = libraryServiceClient.mergeShelves(name, otherShelf);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMergeShelvesStringShelfname method syncMergeShelvesStringShelfname.
public static void syncMergeShelvesStringShelfname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = ShelfName.of("[SHELF_ID]").toString();
ShelfName otherShelf = ShelfName.of("[SHELF_ID]");
Shelf response = libraryServiceClient.mergeShelves(name, otherShelf);
}
}
Aggregations