use of com.google.example.library.v1.DeleteShelfRequest in project gapic-generator-java by googleapis.
the class LibraryServiceClient method deleteShelf.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a shelf. Returns NOT_FOUND if the shelf does not exist.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
* String name = ShelfName.of("[SHELF_ID]").toString();
* libraryServiceClient.deleteShelf(name);
* }
* }</pre>
*
* @param name The name of the shelf to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteShelf(String name) {
DeleteShelfRequest request = DeleteShelfRequest.newBuilder().setName(name).build();
deleteShelf(request);
}
use of com.google.example.library.v1.DeleteShelfRequest in project gapic-generator-java by googleapis.
the class LibraryServiceClient method deleteShelf.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a shelf. Returns NOT_FOUND if the shelf does not exist.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) {
* ShelfName name = ShelfName.of("[SHELF_ID]");
* libraryServiceClient.deleteShelf(name);
* }
* }</pre>
*
* @param name The name of the shelf to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteShelf(ShelfName name) {
DeleteShelfRequest request = DeleteShelfRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteShelf(request);
}
use of com.google.example.library.v1.DeleteShelfRequest 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();
}
}
use of com.google.example.library.v1.DeleteShelfRequest 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);
}
}
use of com.google.example.library.v1.DeleteShelfRequest in project gapic-generator-java by googleapis.
the class LibraryServiceClientTest method deleteShelfTest2.
@Test
public void deleteShelfTest2() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockLibraryService.addResponse(expectedResponse);
String name = "name3373707";
client.deleteShelf(name);
List<AbstractMessage> actualRequests = mockLibraryService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteShelfRequest actualRequest = ((DeleteShelfRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations