use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMergeShelves method syncMergeShelves.
public static void syncMergeShelves() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
MergeShelvesRequest request = MergeShelvesRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).setOtherShelf(ShelfName.of("[SHELF_ID]").toString()).build();
Shelf response = libraryServiceClient.mergeShelves(request);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncMergeShelvesShelfnameShelfname method syncMergeShelvesShelfnameShelfname.
public static void syncMergeShelvesShelfnameShelfname() throws Exception {
// It may require modifications to work in your environment.
try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
ShelfName name = ShelfName.of("[SHELF_ID]");
ShelfName otherShelf = ShelfName.of("[SHELF_ID]");
Shelf response = libraryServiceClient.mergeShelves(name, otherShelf);
}
}
use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateSetEndpoint method syncCreateSetEndpoint.
public static void syncCreateSetEndpoint() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
LibraryServiceSettings libraryServiceSettings = LibraryServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings);
}
use of com.google.cloud.example.library.v1.LibraryServiceClient 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.cloud.example.library.v1.LibraryServiceClient 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);
}
}
Aggregations