use of fixtures.paging.models.PagingGetMultiplePagesWithOffsetNextOptions in project autorest.java by Azure.
the class PagingsImpl method getMultiplePagesWithOffset.
/**
* A paging operation that includes a nextLink that has 10 pages.
*
* @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList<Product> object if successful.
*/
public PagedList<Product> getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions) {
ServiceResponse<Page<Product>> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions).toBlocking().single();
return new PagedList<Product>(response.body()) {
@Override
public Page<Product> nextPage(String nextPageLink) {
PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions();
pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body();
}
};
}
use of fixtures.paging.models.PagingGetMultiplePagesWithOffsetNextOptions in project autorest.java by Azure.
the class PagingsImpl method getMultiplePagesWithOffset.
/**
* A paging operation that includes a nextLink that has 10 pages.
*
* @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
* @param clientRequestId the String value
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PagedList<Product> object if successful.
*/
public PagedList<Product> getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) {
ServiceResponse<Page<Product>> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId).toBlocking().single();
return new PagedList<Product>(response.body()) {
@Override
public Page<Product> nextPage(String nextPageLink) {
PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions();
pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body();
}
};
}
use of fixtures.paging.models.PagingGetMultiplePagesWithOffsetNextOptions in project autorest.java by Azure.
the class PagingsImpl method getMultiplePagesWithOffsetNextSinglePageAsync.
/**
* A paging operation that includes a nextLink that has 10 pages.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable<ServiceResponse<Page<Product>>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
final String clientRequestId = null;
final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = null;
Integer maxresults = null;
Integer timeout = null;
String nextUrl = String.format("%s", nextPageLink);
return service.getMultiplePagesWithOffsetNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<Product>>>>() {
@Override
public Observable<ServiceResponse<Page<Product>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<Product>> result = getMultiplePagesWithOffsetNextDelegate(response);
return Observable.just(new ServiceResponse<Page<Product>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations