use of com.google.example.library.v1.Shelf 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.Shelf in project gapic-generator-java by googleapis.
the class AsyncCreateShelf method asyncCreateShelf.
public static void asyncCreateShelf() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
CreateShelfRequest request = CreateShelfRequest.newBuilder().setShelf(Shelf.newBuilder().build()).build();
ApiFuture<Shelf> future = libraryServiceClient.createShelfCallable().futureCall(request);
// Do something.
Shelf response = future.get();
}
}
use of com.google.example.library.v1.Shelf in project gapic-generator-java by googleapis.
the class SyncCreateShelfShelf method syncCreateShelfShelf.
public static void syncCreateShelfShelf() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
Shelf shelf = Shelf.newBuilder().build();
Shelf response = libraryServiceClient.createShelf(shelf);
}
}
use of com.google.example.library.v1.Shelf 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();
}
}
use of com.google.example.library.v1.Shelf in project gapic-generator-java by googleapis.
the class SyncDeleteBookBookname method syncDeleteBookBookname.
public static void syncDeleteBookBookname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
BookName name = BookName.of("[SHELF]", "[BOOK]");
libraryServiceClient.deleteBook(name);
}
}
Aggregations