ResponseType - resource from server.ExceptionType - in case of a problem or the connection was aborted.public final class ApiCall<ResponseType,ExceptionType extends CoreApiException> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiCall.Builder<ResponseType,ExceptionType extends CoreApiException>
Builder class for the
ApiCall class. |
| Modifier and Type | Method and Description |
|---|---|
ResponseType |
execute()
Execute the ApiCall and returns the expected response.
|
CompletableFuture<ResponseType> |
executeAsync()
Execute the Api call asynchronously and returns the expected response in CompletableFuture.
|
HttpRequest.Builder |
getRequestBuilder() |
io.apimatic.coreinterfaces.http.response.Response |
getResponse() |
<T,I,P> T |
paginate(Function<PaginatedData<I,P,ResponseType,ExceptionType>,T> converter,
Function<PageWrapper<I,ResponseType>,P> responseToPage,
Function<ResponseType,List<I>> responseToItems,
PaginationStrategy... strategies)
Prepare this ApiCall for pagination.
|
ApiCall.Builder<ResponseType,ExceptionType> |
toBuilder()
Converts this ApiCall instance to its builder.
|
public <T,I,P> T paginate(Function<PaginatedData<I,P,ResponseType,ExceptionType>,T> converter, Function<PageWrapper<I,ResponseType>,P> responseToPage, Function<ResponseType,List<I>> responseToItems, PaginationStrategy... strategies)
T - Return type for the paginated data.I - Type of items in pages.P - Type of pages.converter - Converts the PaginatedData into the instance of type T.responseToPage - Converts the PageWrapper into the instance of type P.responseToItems - Extract list of items of type I from response.strategies - List of applicable pagination strategies.public io.apimatic.coreinterfaces.http.response.Response getResponse()
public HttpRequest.Builder getRequestBuilder()
public ResponseType execute() throws IOException, ExceptionType extends CoreApiException
IOException - Signals that an I/O exception of some sort has occurred.ExceptionType - Represents error response from the server.ExceptionType extends CoreApiExceptionpublic CompletableFuture<ResponseType> executeAsync()
CompletableFuture.public ApiCall.Builder<ResponseType,ExceptionType> toBuilder()
Copyright © 2025. All rights reserved.