Search in sources :

Example 1 with PagingGetOdataMultiplePagesOptions

use of fixtures.paging.models.PagingGetOdataMultiplePagesOptions in project autorest.java by Azure.

the class PagingsImpl method getOdataMultiplePagesSinglePageAsync.

/**
 * A paging operation that includes a nextLink in odata format that has 10 pages.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<Product>>> getOdataMultiplePagesSinglePageAsync() {
    final String clientRequestId = null;
    final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions = null;
    Integer maxresults = null;
    Integer timeout = null;
    return service.getOdataMultiplePages(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<PageImpl1<Product>> result = getOdataMultiplePagesDelegate(response);
                return Observable.just(new ServiceResponse<Page<Product>>(result.body(), result.response()));
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : Product(fixtures.paging.models.Product) PagingGetOdataMultiplePagesOptions(fixtures.paging.models.PagingGetOdataMultiplePagesOptions) Page(com.microsoft.azure.Page) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse)

Example 2 with PagingGetOdataMultiplePagesOptions

use of fixtures.paging.models.PagingGetOdataMultiplePagesOptions in project autorest.java by Azure.

the class PagingsImpl method getOdataMultiplePagesNextSinglePageAsync.

/**
 * A paging operation that includes a nextLink in odata format 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&lt;Product&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<Product>>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink) {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    final String clientRequestId = null;
    final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions = null;
    Integer maxresults = null;
    Integer timeout = null;
    String nextUrl = String.format("%s", nextPageLink);
    return service.getOdataMultiplePagesNext(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<PageImpl1<Product>> result = getOdataMultiplePagesNextDelegate(response);
                return Observable.just(new ServiceResponse<Page<Product>>(result.body(), result.response()));
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : Product(fixtures.paging.models.Product) PagingGetOdataMultiplePagesOptions(fixtures.paging.models.PagingGetOdataMultiplePagesOptions) Page(com.microsoft.azure.Page) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse)

Aggregations

Page (com.microsoft.azure.Page)2 ServiceResponse (com.microsoft.rest.ServiceResponse)2 PagingGetOdataMultiplePagesOptions (fixtures.paging.models.PagingGetOdataMultiplePagesOptions)2 Product (fixtures.paging.models.Product)2 ResponseBody (okhttp3.ResponseBody)2 Response (retrofit2.Response)2 Observable (rx.Observable)2