Search in sources :

Example 31 with LibraryServiceClient

use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.

the class AsyncDeleteShelf method asyncDeleteShelf.

public static void asyncDeleteShelf() throws Exception {
    // It may require modifications to work in your environment.
    try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        DeleteShelfRequest request = DeleteShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build();
        ApiFuture<Empty> future = libraryServiceClient.deleteShelfCallable().futureCall(request);
        // Do something.
        future.get();
    }
}
Also used : Empty(com.google.protobuf.Empty) LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) DeleteShelfRequest(com.google.example.library.v1.DeleteShelfRequest)

Example 32 with LibraryServiceClient

use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.

the class SyncDeleteShelf method syncDeleteShelf.

public static void syncDeleteShelf() throws Exception {
    // It may require modifications to work in your environment.
    try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        DeleteShelfRequest request = DeleteShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build();
        libraryServiceClient.deleteShelf(request);
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) DeleteShelfRequest(com.google.example.library.v1.DeleteShelfRequest)

Example 33 with LibraryServiceClient

use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.

the class SyncDeleteShelfShelfname method syncDeleteShelfShelfname.

public static void syncDeleteShelfShelfname() throws Exception {
    // It may require modifications to work in your environment.
    try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        ShelfName name = ShelfName.of("[SHELF_ID]");
        libraryServiceClient.deleteShelf(name);
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) ShelfName(com.google.example.library.v1.ShelfName)

Example 34 with LibraryServiceClient

use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.

the class AsyncListShelves method asyncListShelves.

public static void asyncListShelves() throws Exception {
    // It may require modifications to work in your environment.
    try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
        ListShelvesRequest request = ListShelvesRequest.newBuilder().setPageSize(883849137).setPageToken("pageToken873572522").build();
        ApiFuture<Shelf> future = libraryServiceClient.listShelvesPagedCallable().futureCall(request);
        // Do something.
        for (Shelf element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) Shelf(com.google.example.library.v1.Shelf) ListShelvesRequest(com.google.example.library.v1.ListShelvesRequest)

Example 35 with LibraryServiceClient

use of com.google.cloud.example.library.v1.LibraryServiceClient in project gapic-generator-java by googleapis.

the class AsyncMergeShelves method asyncMergeShelves.

public static void asyncMergeShelves() 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();
        ApiFuture<Shelf> future = libraryServiceClient.mergeShelvesCallable().futureCall(request);
        // Do something.
        Shelf response = future.get();
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) Shelf(com.google.example.library.v1.Shelf) MergeShelvesRequest(com.google.example.library.v1.MergeShelvesRequest)

Aggregations

LibraryServiceClient (com.google.cloud.example.library.v1.LibraryServiceClient)43 Book (com.google.example.library.v1.Book)19 Shelf (com.google.example.library.v1.Shelf)14 ShelfName (com.google.example.library.v1.ShelfName)8 BookName (com.google.example.library.v1.BookName)4 LibraryServiceSettings (com.google.cloud.example.library.v1.LibraryServiceSettings)2 CreateBookRequest (com.google.example.library.v1.CreateBookRequest)2 DeleteBookRequest (com.google.example.library.v1.DeleteBookRequest)2 DeleteShelfRequest (com.google.example.library.v1.DeleteShelfRequest)2 GetBookRequest (com.google.example.library.v1.GetBookRequest)2 GetShelfRequest (com.google.example.library.v1.GetShelfRequest)2 ListBooksRequest (com.google.example.library.v1.ListBooksRequest)2 ListShelvesRequest (com.google.example.library.v1.ListShelvesRequest)2 MergeShelvesRequest (com.google.example.library.v1.MergeShelvesRequest)2 MoveBookRequest (com.google.example.library.v1.MoveBookRequest)2 UpdateBookRequest (com.google.example.library.v1.UpdateBookRequest)2 Empty (com.google.protobuf.Empty)2 CreateShelfRequest (com.google.example.library.v1.CreateShelfRequest)1 ListBooksResponse (com.google.example.library.v1.ListBooksResponse)1 ListShelvesResponse (com.google.example.library.v1.ListShelvesResponse)1