use of com.google.example.library.v1.Book 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.example.library.v1.Book 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);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class AsyncCreateBook method asyncCreateBook.
public static void asyncCreateBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
CreateBookRequest request = CreateBookRequest.newBuilder().setParent(ShelfName.of("[SHELF_ID]").toString()).setBook(Book.newBuilder().build()).build();
ApiFuture<Book> future = libraryServiceClient.createBookCallable().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 SyncCreateBook method syncCreateBook.
public static void syncCreateBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
CreateBookRequest request = CreateBookRequest.newBuilder().setParent(ShelfName.of("[SHELF_ID]").toString()).setBook(Book.newBuilder().build()).build();
Book response = libraryServiceClient.createBook(request);
}
}
use of com.google.example.library.v1.Book in project gapic-generator-java by googleapis.
the class SyncCreateBookShelfnameBook method syncCreateBookShelfnameBook.
public static void syncCreateBookShelfnameBook() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ShelfName parent = ShelfName.of("[SHELF_ID]");
Book book = Book.newBuilder().build();
Book response = libraryServiceClient.createBook(parent, book);
}
}
Aggregations