use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncMoveBookBooknameShelfname method syncMoveBookBooknameShelfname.
public static void syncMoveBookBooknameShelfname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
BookName name = BookName.of("[SHELF]", "[BOOK]");
ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
Book response = libraryServiceClient.moveBook(name, otherShelfName);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncMoveBookBooknameString method syncMoveBookBooknameString.
public static void syncMoveBookBooknameString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
BookName name = BookName.of("[SHELF]", "[BOOK]");
String otherShelfName = ShelfName.of("[SHELF_ID]").toString();
Book response = libraryServiceClient.moveBook(name, otherShelfName);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncMoveBookStringShelfname method syncMoveBookStringShelfname.
public static void syncMoveBookStringShelfname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = BookName.of("[SHELF]", "[BOOK]").toString();
ShelfName otherShelfName = ShelfName.of("[SHELF_ID]");
Book response = libraryServiceClient.moveBook(name, otherShelfName);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class AsyncUpdateBook method asyncUpdateBook.
public static void asyncUpdateBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
UpdateBookRequest request = UpdateBookRequest.newBuilder().setBook(Book.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
ApiFuture<Book> future = libraryServiceClient.updateBookCallable().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 AsyncDeleteBook method asyncDeleteBook.
public static void asyncDeleteBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
DeleteBookRequest request = DeleteBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).build();
ApiFuture<Empty> future = libraryServiceClient.deleteBookCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations