use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncGetBookBookname method syncGetBookBookname.
public static void syncGetBookBookname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
BookName name = BookName.of("[SHELF]", "[BOOK]");
Book response = libraryServiceClient.getBook(name);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncGetBookString method syncGetBookString.
public static void syncGetBookString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = BookName.of("[SHELF]", "[BOOK]").toString();
Book response = libraryServiceClient.getBook(name);
}
}
use of com.google.example.library.v1.Book 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.example.library.v1.Book in project gapic-generator-java by googleapis.
the class AsyncMoveBook method asyncMoveBook.
public static void asyncMoveBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
MoveBookRequest request = MoveBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).setOtherShelfName(ShelfName.of("[SHELF_ID]").toString()).build();
ApiFuture<Book> future = libraryServiceClient.moveBookCallable().futureCall(request);
// Do something.
Book response = future.get();
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncMoveBook method syncMoveBook.
public static void syncMoveBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
MoveBookRequest request = MoveBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).setOtherShelfName(ShelfName.of("[SHELF_ID]").toString()).build();
Book response = libraryServiceClient.moveBook(request);
}
}
Aggregations