use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMergeShelvesStringString method syncMergeShelvesStringString.
public static void syncMergeShelvesStringString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = ShelfName.of("[SHELF_ID]").toString();
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 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.cloud.example.library.v1.LibraryServiceClient 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);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMoveBookStringString method syncMoveBookStringString.
public static void syncMoveBookStringString() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
String name = BookName.of("[SHELF]", "[BOOK]").toString();
String otherShelfName = ShelfName.of("[SHELF_ID]").toString();
Book response = libraryServiceClient.moveBook(name, otherShelfName);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncDeleteBook method syncDeleteBook.
public static void syncDeleteBook() 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();
libraryServiceClient.deleteBook(request);
}
}
Aggregations