Search in sources :

Example 36 with LibraryServiceClient

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);
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) Shelf(com.google.example.library.v1.Shelf) MergeShelvesRequest(com.google.example.library.v1.MergeShelvesRequest)

Example 37 with LibraryServiceClient

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);
    }
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) ShelfName(com.google.example.library.v1.ShelfName) Shelf(com.google.example.library.v1.Shelf)

Example 38 with LibraryServiceClient

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);
}
Also used : LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) LibraryServiceSettings(com.google.cloud.example.library.v1.LibraryServiceSettings)

Example 39 with LibraryServiceClient

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();
    }
}
Also used : CreateBookRequest(com.google.example.library.v1.CreateBookRequest) LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) Book(com.google.example.library.v1.Book)

Example 40 with LibraryServiceClient

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);
    }
}
Also used : CreateBookRequest(com.google.example.library.v1.CreateBookRequest) LibraryServiceClient(com.google.cloud.example.library.v1.LibraryServiceClient) Book(com.google.example.library.v1.Book)

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