text:
package fixtures.paging.implementation;

import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureServiceFuture;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;

/**
 * An instance of this class provides access to all the operations defined
 * in Pagings.
 */
public class PagingsInner {
    /** The Retrofit service to perform REST calls. */
    private PagingsService service;
    /** The service client containing this operation class. */
    private AutoRestPagingTestServiceImpl client;

    /**
     * Initializes an instance of PagingsInner.
     *
     * @param retrofit the Retrofit instance built from a Retrofit Builder.
     * @param client the instance of the service client containing this operation class.
     */
    public PagingsInner(Retrofit retrofit, AutoRestPagingTestServiceImpl client) {
        this.service = retrofit.create(PagingsService.class);
        this.client = client;
    }

    /**
     * The interface defining all the services for Pagings to be
     * used by Retrofit to perform actually REST calls.
     */
    interface PagingsService {
        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePages" })
        @GET("paging/single")
        Observable<Response<ResponseBody>> getSinglePages(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePages" })
        @GET("paging/multiple")
        Observable<Response<ResponseBody>> getMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePages" })
        @GET("paging/multiple/odata")
        Observable<Response<ResponseBody>> getOdataMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffset" })
        @GET("paging/multiple/withpath/{offset}")
        Observable<Response<ResponseBody>> getMultiplePagesWithOffset(@Path("offset") int offset, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirst" })
        @GET("paging/multiple/retryfirst")
        Observable<Response<ResponseBody>> getMultiplePagesRetryFirst(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecond" })
        @GET("paging/multiple/retrysecond")
        Observable<Response<ResponseBody>> getMultiplePagesRetrySecond(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailure" })
        @GET("paging/single/failure")
        Observable<Response<ResponseBody>> getSinglePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailure" })
        @GET("paging/multiple/failure")
        Observable<Response<ResponseBody>> getMultiplePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUri" })
        @GET("paging/multiple/failureuri")
        Observable<Response<ResponseBody>> getMultiplePagesFailureUri(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentNextLink" })
        @GET("paging/multiple/fragment/{tenant}")
        Observable<Response<ResponseBody>> getMultiplePagesFragmentNextLink(@Path("tenant") String tenant, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentWithGroupingNextLink" })
        @GET("paging/multiple/fragmentwithgrouping/{tenant}")
        Observable<Response<ResponseBody>> getMultiplePagesFragmentWithGroupingNextLink(@Path("tenant") String tenant, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragment" })
        @GET
        Observable<Response<ResponseBody>> nextFragment(@Url String nextUrl, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragmentWithGrouping" })
        @GET
        Observable<Response<ResponseBody>> nextFragmentWithGrouping(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesNext" })
        @GET
        Observable<Response<ResponseBody>> getSinglePagesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePagesNext" })
        @GET
        Observable<Response<ResponseBody>> getOdataMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffsetNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesWithOffsetNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirstNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesRetryFirstNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecondNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesRetrySecondNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailureNext" })
        @GET
        Observable<Response<ResponseBody>> getSinglePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUriNext" })
        @GET
        Observable<Response<ResponseBody>> getMultiplePagesFailureUriNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getSinglePages() {
        ServiceResponse<Page<ProductInner>> response = getSinglePagesSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getSinglePagesAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getSinglePagesSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getSinglePagesNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getSinglePagesAsync() {
        return getSinglePagesWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesWithServiceResponseAsync() {
        return getSinglePagesSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesSinglePageAsync() {
        return service.getSinglePages(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getSinglePagesDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getSinglePagesDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePages() {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesAsync() {
        return getMultiplePagesWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithServiceResponseAsync() {
        return getMultiplePagesSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesSinglePageAsync() {
        final String clientRequestId = null;
        final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions = null;
        Integer maxresults = null;
        Integer timeout = null;
        return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePages(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        return getMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetMultiplePagesOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        return getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param clientRequestId the String value
    ServiceResponse<PageImpl<ProductInner>> * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        Validator.validate(pagingGetMultiplePagesOptions);
        Integer maxresults = null;
        if (pagingGetMultiplePagesOptions != null) {
            maxresults = pagingGetMultiplePagesOptions.maxresults();
        }
        Integer timeout = null;
        if (pagingGetMultiplePagesOptions != null) {
            timeout = pagingGetMultiplePagesOptions.timeout();
        }
        return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getOdataMultiplePages() {
        ServiceResponse<Page<ProductInner>> response = getOdataMultiplePagesSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getOdataMultiplePagesAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getOdataMultiplePagesSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getOdataMultiplePagesAsync() {
        return getOdataMultiplePagesWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesWithServiceResponseAsync() {
        return getOdataMultiplePagesSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesSinglePageAsync() {
        final String clientRequestId = null;
        final PagingGetOdataMultiplePagesOptionsInner 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<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getOdataMultiplePagesDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getOdataMultiplePages(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        ServiceResponse<Page<ProductInner>> response = getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        return getOdataMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetOdataMultiplePagesOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        return getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param clientRequestId the String value
    ServiceResponse<PageImpl1<ProductInner>> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        Validator.validate(pagingGetOdataMultiplePagesOptions);
        Integer maxresults = null;
        if (pagingGetOdataMultiplePagesOptions != null) {
            maxresults = pagingGetOdataMultiplePagesOptions.maxresults();
        }
        Integer timeout = null;
        if (pagingGetOdataMultiplePagesOptions != null) {
            timeout = pagingGetOdataMultiplePagesOptions.timeout();
        }
        return service.getOdataMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getOdataMultiplePagesDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> getOdataMultiplePagesDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                    pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                    pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                    return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) {
        return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) {
        return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                    pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                    pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                    return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) {
        if (pagingGetMultiplePagesWithOffsetOptions == null) {
            throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null.");
        }
        Validator.validate(pagingGetMultiplePagesWithOffsetOptions);
        final String clientRequestId = null;
        Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults();
        int offset = pagingGetMultiplePagesWithOffsetOptions.offset();
        Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout();
        return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesWithOffsetDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @param clientRequestId the String value
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @param clientRequestId the String value
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                    pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                    pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                    return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @param clientRequestId the String value
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) {
        return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
     * @param clientRequestId the String value
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) {
        return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner();
                    pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults());
                    pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout());
                    return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation
    ServiceResponse<PageImpl<ProductInner>> * @param clientRequestId the String value
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) {
        if (pagingGetMultiplePagesWithOffsetOptions == null) {
            throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null.");
        }
        Validator.validate(pagingGetMultiplePagesWithOffsetOptions);
        Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults();
        int offset = pagingGetMultiplePagesWithOffsetOptions.offset();
        Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout();
        return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesWithOffsetDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesWithOffsetDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesRetryFirst() {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesRetryFirstSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesRetryFirstAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesRetryFirstSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesRetryFirstAsync() {
        return getMultiplePagesRetryFirstWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetryFirstWithServiceResponseAsync() {
        return getMultiplePagesRetryFirstSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetryFirstSinglePageAsync() {
        return service.getMultiplePagesRetryFirst(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesRetryFirstDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesRetryFirstDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesRetrySecond() {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesRetrySecondSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesRetrySecondAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesRetrySecondSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesRetrySecondAsync() {
        return getMultiplePagesRetrySecondWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetrySecondWithServiceResponseAsync() {
        return getMultiplePagesRetrySecondSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetrySecondSinglePageAsync() {
        return service.getMultiplePagesRetrySecond(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesRetrySecondDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesRetrySecondDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getSinglePagesFailure() {
        ServiceResponse<Page<ProductInner>> response = getSinglePagesFailureSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getSinglePagesFailureAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getSinglePagesFailureSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getSinglePagesFailureNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getSinglePagesFailureAsync() {
        return getSinglePagesFailureWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesFailureWithServiceResponseAsync() {
        return getSinglePagesFailureSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesFailureSinglePageAsync() {
        return service.getSinglePagesFailure(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getSinglePagesFailureDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getSinglePagesFailureDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFailure() {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFailureSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFailureAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFailureSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesFailureNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFailureAsync() {
        return getMultiplePagesFailureWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureWithServiceResponseAsync() {
        return getMultiplePagesFailureSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureSinglePageAsync() {
        return service.getMultiplePagesFailure(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesFailureDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesFailureDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFailureUri() {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFailureUriSinglePageAsync().toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFailureUriAsync(final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFailureUriSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFailureUriAsync() {
        return getMultiplePagesFailureUriWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureUriWithServiceResponseAsync() {
        return getMultiplePagesFailureUriSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureUriSinglePageAsync() {
        return service.getMultiplePagesFailureUri(this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesFailureUriDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesFailureUriDelegate(Response<ResponseBody> response) throws CloudException, IOException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param apiVersion Sets the api version to use.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFragmentNextLink(final String tenant, final String apiVersion) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextLink) {
                return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param apiVersion Sets the api version to use.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextLink) {
                    return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param apiVersion Sets the api version to use.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion) {
        return getMultiplePagesFragmentNextLinkWithServiceResponseAsync(tenant, apiVersion)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param apiVersion Sets the api version to use.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFragmentNextLinkWithServiceResponseAsync(final String tenant, final String apiVersion) {
        return getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextLink = page.body().nextPageLink();
                    if (nextLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion));
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param tenant Sets the tenant to use.
    ServiceResponse<PageImpl1<ProductInner>> * @param apiVersion Sets the api version to use.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFragmentNextLinkSinglePageAsync(final String tenant, final String apiVersion) {
        if (tenant == null) {
            throw new IllegalArgumentException("Parameter tenant is required and cannot be null.");
        }
        if (apiVersion == null) {
            throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
        }
        return service.getMultiplePagesFragmentNextLink(tenant, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getMultiplePagesFragmentNextLinkDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> getMultiplePagesFragmentNextLinkDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment with parameters grouped.
     *
     * @param customParameterGroup Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFragmentWithGroupingNextLink(final CustomParameterGroupInner customParameterGroup) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextLink) {
                return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment with parameters grouped.
     *
     * @param customParameterGroup Additional parameters for the operation
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroupInner customParameterGroup, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextLink) {
                    return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment with parameters grouped.
     *
     * @param customParameterGroup Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroupInner customParameterGroup) {
        return getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(customParameterGroup)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment with parameters grouped.
     *
     * @param customParameterGroup Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(final CustomParameterGroupInner customParameterGroup) {
        return getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextLink = page.body().nextPageLink();
                    if (nextLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup));
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment with parameters grouped.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param customParameterGroup Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(final CustomParameterGroupInner customParameterGroup) {
        if (customParameterGroup == null) {
            throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null.");
        }
        Validator.validate(customParameterGroup);
        String apiVersion = customParameterGroup.apiVersion();
        String tenant = customParameterGroup.tenant();
        return service.getMultiplePagesFragmentWithGroupingNextLink(tenant, this.client.acceptLanguage(), apiVersion, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getMultiplePagesFragmentWithGroupingNextLinkDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> getMultiplePagesFragmentWithGroupingNextLinkDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param nextLink Next link for list operation.
     * @param apiVersion Sets the api version to use.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> nextFragment(final String tenant, final String nextLink, final String apiVersion) {
        ServiceResponse<Page<ProductInner>> response = nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextLink) {
                return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param nextLink Next link for list operation.
     * @param apiVersion Sets the api version to use.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            nextFragmentSinglePageAsync(tenant, nextLink, apiVersion),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextLink) {
                    return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param nextLink Next link for list operation.
     * @param apiVersion Sets the api version to use.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion) {
        return nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param tenant Sets the tenant to use.
     * @param nextLink Next link for list operation.
     * @param apiVersion Sets the api version to use.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> nextFragmentWithServiceResponseAsync(final String tenant, final String nextLink, final String apiVersion) {
        return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextLink = page.body().nextPageLink();
                    if (nextLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion));
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param tenant Sets the tenant to use.
    ServiceResponse<PageImpl1<ProductInner>> * @param nextLink Next link for list operation.
    ServiceResponse<PageImpl1<ProductInner>> * @param apiVersion Sets the api version to use.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> nextFragmentSinglePageAsync(final String tenant, final String nextLink, final String apiVersion) {
        if (tenant == null) {
            throw new IllegalArgumentException("Parameter tenant is required and cannot be null.");
        }
        if (nextLink == null) {
            throw new IllegalArgumentException("Parameter nextLink is required and cannot be null.");
        }
        if (apiVersion == null) {
            throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
        }
        String nextUrl = String.format("paging/multiple/fragment/%s/%s", tenant, nextLink);
        return service.nextFragment(nextUrl, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = nextFragmentDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> nextFragmentDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param nextLink Next link for list operation.
     * @param customParameterGroup Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> nextFragmentWithGrouping(final String nextLink, final CustomParameterGroupInner customParameterGroup) {
        ServiceResponse<Page<ProductInner>> response = nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextLink) {
                return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param nextLink Next link for list operation.
     * @param customParameterGroup Additional parameters for the operation
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextLink) {
                    return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param nextLink Next link for list operation.
     * @param customParameterGroup Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) {
        return nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
     * @param nextLink Next link for list operation.
     * @param customParameterGroup Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> nextFragmentWithGroupingWithServiceResponseAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) {
        return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextLink = page.body().nextPageLink();
                    if (nextLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup));
                }
            });
    }

    /**
     * A paging operation that doesn't return a full URL, just a fragment.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param nextLink Next link for list operation.
    ServiceResponse<PageImpl1<ProductInner>> * @param customParameterGroup Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> nextFragmentWithGroupingSinglePageAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) {
        if (nextLink == null) {
            throw new IllegalArgumentException("Parameter nextLink is required and cannot be null.");
        }
        if (customParameterGroup == null) {
            throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null.");
        }
        Validator.validate(customParameterGroup);
        String apiVersion = customParameterGroup.apiVersion();
        String tenant = customParameterGroup.tenant();
        String nextUrl = String.format("paging/multiple/fragmentwithgrouping/%s/%s", tenant, nextLink);
        return service.nextFragmentWithGrouping(nextUrl, this.client.acceptLanguage(), apiVersion, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = nextFragmentWithGroupingDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> nextFragmentWithGroupingDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getSinglePagesNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getSinglePagesNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getSinglePagesNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getSinglePagesNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getSinglePagesNextAsync(final String nextPageLink) {
        return getSinglePagesNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesNextWithServiceResponseAsync(final String nextPageLink) {
        return getSinglePagesNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that finishes on the first call without a nextlink.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getSinglePagesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getSinglePagesNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getSinglePagesNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesNextAsync(final String nextPageLink) {
        return getMultiplePagesNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        final String clientRequestId = null;
        final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions = null;
        Integer maxresults = null;
        Integer timeout = null;
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        return getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
    ServiceResponse<PageImpl<ProductInner>> * @param clientRequestId the String value
    ServiceResponse<PageImpl<ProductInner>> * @param pagingGetMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        Validator.validate(pagingGetMultiplePagesOptions);
        Integer maxresults = null;
        if (pagingGetMultiplePagesOptions != null) {
            maxresults = pagingGetMultiplePagesOptions.maxresults();
        }
        Integer timeout = null;
        if (pagingGetMultiplePagesOptions != null) {
            timeout = pagingGetMultiplePagesOptions.timeout();
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * 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.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getOdataMultiplePagesNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body();
            }
        };
    }

    /**
     * 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.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getOdataMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getOdataMultiplePagesNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null);
                }
            },
            serviceCallback);
    }

    /**
     * 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.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getOdataMultiplePagesNextAsync(final String nextPageLink) {
        return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * 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.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) {
        return getOdataMultiplePagesNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null));
                }
            });
    }

    /**
     * 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.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        final String clientRequestId = null;
        final PagingGetOdataMultiplePagesOptionsInner 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<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getOdataMultiplePagesNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * 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.
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getOdataMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        ServiceResponse<Page<ProductInner>> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * 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.
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions);
                }
            },
            serviceCallback);
    }

    /**
     * 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.
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * 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.
     * @param clientRequestId the String value
     * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink in odata format that has 10 pages.
     *
    ServiceResponse<PageImpl1<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
    ServiceResponse<PageImpl1<ProductInner>> * @param clientRequestId the String value
    ServiceResponse<PageImpl1<ProductInner>> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        Validator.validate(pagingGetOdataMultiplePagesOptions);
        Integer maxresults = null;
        if (pagingGetOdataMultiplePagesOptions != null) {
            maxresults = pagingGetOdataMultiplePagesOptions.maxresults();
        }
        Integer timeout = null;
        if (pagingGetOdataMultiplePagesOptions != null) {
            timeout = pagingGetOdataMultiplePagesOptions.timeout();
        }
        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<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl1<ProductInner>> result = getOdataMultiplePagesNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl1<ProductInner>> getOdataMultiplePagesNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl1<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl1<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesWithOffsetNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesWithOffsetNextAsync(final String nextPageLink) {
        return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, null));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        final String clientRequestId = null;
        final PagingGetMultiplePagesWithOffsetNextOptionsInner 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<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesWithOffsetNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesWithOffsetNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) {
        return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param clientRequestId the String value
     * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) {
        return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
    ServiceResponse<PageImpl<ProductInner>> * @param clientRequestId the String value
    ServiceResponse<PageImpl<ProductInner>> * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        Validator.validate(pagingGetMultiplePagesWithOffsetNextOptions);
        Integer maxresults = null;
        if (pagingGetMultiplePagesWithOffsetNextOptions != null) {
            maxresults = pagingGetMultiplePagesWithOffsetNextOptions.maxresults();
        }
        Integer timeout = null;
        if (pagingGetMultiplePagesWithOffsetNextOptions != null) {
            timeout = pagingGetMultiplePagesWithOffsetNextOptions.timeout();
        }
        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<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesWithOffsetNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesWithOffsetNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesRetryFirstNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesRetryFirstNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesRetryFirstNextAsync(final String nextPageLink) {
        return getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetryFirstNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetryFirstNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesRetryFirstNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesRetryFirstNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesRetryFirstNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesRetrySecondNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesRetrySecondNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesRetrySecondNextAsync(final String nextPageLink) {
        return getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetrySecondNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesRetrySecondNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesRetrySecondNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesRetrySecondNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesRetrySecondNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getSinglePagesFailureNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getSinglePagesFailureNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getSinglePagesFailureNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getSinglePagesFailureNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getSinglePagesFailureNextAsync(final String nextPageLink) {
        return getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesFailureNextWithServiceResponseAsync(final String nextPageLink) {
        return getSinglePagesFailureNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the first call.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getSinglePagesFailureNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getSinglePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getSinglePagesFailureNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getSinglePagesFailureNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFailureNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFailureNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFailureNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesFailureNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFailureNextAsync(final String nextPageLink) {
        return getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesFailureNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives a 400 on the second call.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesFailureNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesFailureNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object if successful.
     */
    public PagedList<ProductInner> getMultiplePagesFailureUriNext(final String nextPageLink) {
        ServiceResponse<Page<ProductInner>> response = getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<ProductInner>(response.body()) {
            @Override
            public Page<ProductInner> nextPage(String nextPageLink) {
                return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<ProductInner>> getMultiplePagesFailureUriNextAsync(final String nextPageLink, final ServiceFuture<List<ProductInner>> serviceFuture, final ListOperationCallback<ProductInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(String nextPageLink) {
                    return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<Page<ProductInner>> getMultiplePagesFailureUriNextAsync(final String nextPageLink) {
        return getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<ProductInner>>, Page<ProductInner>>() {
                @Override
                public Page<ProductInner> call(ServiceResponse<Page<ProductInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the observable to the PagedList<ProductInner> object
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureUriNextWithServiceResponseAsync(final String nextPageLink) {
        return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<ProductInner>>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(ServiceResponse<Page<ProductInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * A paging operation that receives an invalid nextLink.
     *
    ServiceResponse<PageImpl<ProductInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<ProductInner>>> getMultiplePagesFailureUriNextSinglePageAsync(final String nextPageLink) {
        if (nextPageLink == null) {
            throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
        }
        String nextUrl = String.format("%s", nextPageLink);
        return service.getMultiplePagesFailureUriNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ProductInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ProductInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ProductInner>> result = getMultiplePagesFailureUriNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ProductInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    private ServiceResponse<PageImpl<ProductInner>> getMultiplePagesFailureUriNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
        return this.client.restClient().responseBuilderFactory().<PageImpl<ProductInner>, CloudException>newInstance(this.client.serializerAdapter())
                .register(200, new TypeToken<PageImpl<ProductInner>>() { }.getType())
                .registerError(CloudException.class)
                .build(response);
    }

}