/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.management.eventgrid.v2019_06_01.implementation;

import com.microsoft.azure.arm.collection.InnerSupportsDelete;
import com.microsoft.azure.arm.collection.InnerSupportsListing;
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.management.eventgrid.v2019_06_01.EventSubscriptionUpdateParameters;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceCallback;
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.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.HTTP;
import retrofit2.http.PATCH;
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.PUT;
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 EventSubscriptions.
 */
public class EventSubscriptionsInner implements InnerSupportsDelete<Void>, InnerSupportsListing<EventSubscriptionInner> {
    /** The Retrofit service to perform REST calls. */
    private EventSubscriptionsService service;
    /** The service client containing this operation class. */
    private EventGridManagementClientImpl client;

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

    /**
     * The interface defining all the services for EventSubscriptions to be
     * used by Retrofit to perform actually REST calls.
     */
    interface EventSubscriptionsService {
        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions get" })
        @GET("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}")
        Observable<Response<ResponseBody>> get(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions createOrUpdate" })
        @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}")
        Observable<Response<ResponseBody>> createOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions beginCreateOrUpdate" })
        @PUT("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}")
        Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionInner eventSubscriptionInfo, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions delete" })
        @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true)
        Observable<Response<ResponseBody>> delete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions beginDelete" })
        @HTTP(path = "{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", method = "DELETE", hasBody = true)
        Observable<Response<ResponseBody>> beginDelete(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions update" })
        @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}")
        Observable<Response<ResponseBody>> update(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions beginUpdate" })
        @PATCH("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}")
        Observable<Response<ResponseBody>> beginUpdate(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @Body EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions getFullUrl" })
        @POST("{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl")
        Observable<Response<ResponseBody>> getFullUrl(@Path(value = "scope", encoded = true) String scope, @Path("eventSubscriptionName") String eventSubscriptionName, @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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions list" })
        @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions")
        Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listGlobalBySubscriptionForTopicType" })
        @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions")
        Observable<Response<ResponseBody>> listGlobalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByResourceGroup" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions")
        Observable<Response<ResponseBody>> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listGlobalByResourceGroupForTopicType" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions")
        Observable<Response<ResponseBody>> listGlobalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalBySubscription" })
        @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions")
        Observable<Response<ResponseBody>> listRegionalBySubscription(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalByResourceGroup" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions")
        Observable<Response<ResponseBody>> listRegionalByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalBySubscriptionForTopicType" })
        @GET("subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions")
        Observable<Response<ResponseBody>> listRegionalBySubscriptionForTopicType(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalByResourceGroupForTopicType" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions")
        Observable<Response<ResponseBody>> listRegionalByResourceGroupForTopicType(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("location") String location, @Path("topicTypeName") String topicTypeName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByResource" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions")
        Observable<Response<ResponseBody>> listByResource(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerNamespace") String providerNamespace, @Path("resourceTypeName") String resourceTypeName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByDomainTopic" })
        @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions")
        Observable<Response<ResponseBody>> listByDomainTopic(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("domainName") String domainName, @Path("topicName") String topicName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listNext" })
        @GET
        Observable<Response<ResponseBody>> listNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listGlobalBySubscriptionForTopicTypeNext" })
        @GET
        Observable<Response<ResponseBody>> listGlobalBySubscriptionForTopicTypeNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByResourceGroupNext" })
        @GET
        Observable<Response<ResponseBody>> listByResourceGroupNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listGlobalByResourceGroupForTopicTypeNext" })
        @GET
        Observable<Response<ResponseBody>> listGlobalByResourceGroupForTopicTypeNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalBySubscriptionNext" })
        @GET
        Observable<Response<ResponseBody>> listRegionalBySubscriptionNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalByResourceGroupNext" })
        @GET
        Observable<Response<ResponseBody>> listRegionalByResourceGroupNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalBySubscriptionForTopicTypeNext" })
        @GET
        Observable<Response<ResponseBody>> listRegionalBySubscriptionForTopicTypeNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listRegionalByResourceGroupForTopicTypeNext" })
        @GET
        Observable<Response<ResponseBody>> listRegionalByResourceGroupForTopicTypeNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByResourceNext" })
        @GET
        Observable<Response<ResponseBody>> listByResourceNext(@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: com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptions listByDomainTopicNext" })
        @GET
        Observable<Response<ResponseBody>> listByDomainTopicNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

    }

    /**
     * Get an event subscription.
     * Get properties of an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionInner object if successful.
     */
    public EventSubscriptionInner get(String scope, String eventSubscriptionName) {
        return getWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body();
    }

    /**
     * Get an event subscription.
     * Get properties of an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionInner> getAsync(String scope, String eventSubscriptionName, final ServiceCallback<EventSubscriptionInner> serviceCallback) {
        return ServiceFuture.fromResponse(getWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback);
    }

    /**
     * Get an event subscription.
     * Get properties of an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<EventSubscriptionInner> getAsync(String scope, String eventSubscriptionName) {
        return getWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1<ServiceResponse<EventSubscriptionInner>, EventSubscriptionInner>() {
            @Override
            public EventSubscriptionInner call(ServiceResponse<EventSubscriptionInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Get an event subscription.
     * Get properties of an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<ServiceResponse<EventSubscriptionInner>> getWithServiceResponseAsync(String scope, String eventSubscriptionName) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.get(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EventSubscriptionInner>>>() {
                @Override
                public Observable<ServiceResponse<EventSubscriptionInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<EventSubscriptionInner> clientResponse = getDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionInner object if successful.
     */
    public EventSubscriptionInner createOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().last().body();
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback<EventSubscriptionInner> serviceCallback) {
        return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback);
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<EventSubscriptionInner> createOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        return createOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1<ServiceResponse<EventSubscriptionInner>, EventSubscriptionInner>() {
            @Override
            public EventSubscriptionInner call(ServiceResponse<EventSubscriptionInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<ServiceResponse<EventSubscriptionInner>> createOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (eventSubscriptionInfo == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        Validator.validate(eventSubscriptionInfo);
        Observable<Response<ResponseBody>> observable = service.createOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
        return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<EventSubscriptionInner>() { }.getType());
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionInner object if successful.
     */
    public EventSubscriptionInner beginCreateOrUpdate(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).toBlocking().single().body();
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionInner> beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo, final ServiceCallback<EventSubscriptionInner> serviceCallback) {
        return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo), serviceCallback);
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<EventSubscriptionInner> beginCreateOrUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        return beginCreateOrUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionInfo).map(new Func1<ServiceResponse<EventSubscriptionInner>, EventSubscriptionInner>() {
            @Override
            public EventSubscriptionInner call(ServiceResponse<EventSubscriptionInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Create or update an event subscription.
     * Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope.
     *
     * @param scope The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
     * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<ServiceResponse<EventSubscriptionInner>> beginCreateOrUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionInner eventSubscriptionInfo) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (eventSubscriptionInfo == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        Validator.validate(eventSubscriptionInfo);
        return service.beginCreateOrUpdate(scope, eventSubscriptionName, eventSubscriptionInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EventSubscriptionInner>>>() {
                @Override
                public Observable<ServiceResponse<EventSubscriptionInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<EventSubscriptionInner> clientResponse = beginCreateOrUpdateDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     */
    public void delete(String scope, String eventSubscriptionName) {
        deleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().last().body();
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<Void> deleteAsync(String scope, String eventSubscriptionName, final ServiceCallback<Void> serviceCallback) {
        return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback);
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<Void> deleteAsync(String scope, String eventSubscriptionName) {
        return deleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1<ServiceResponse<Void>, Void>() {
            @Override
            public Void call(ServiceResponse<Void> response) {
                return response.body();
            }
        });
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String scope, String eventSubscriptionName) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        Observable<Response<ResponseBody>> observable = service.delete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
        return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType());
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     */
    public void beginDelete(String scope, String eventSubscriptionName) {
        beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body();
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<Void> beginDeleteAsync(String scope, String eventSubscriptionName, final ServiceCallback<Void> serviceCallback) {
        return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback);
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<Void> beginDeleteAsync(String scope, String eventSubscriptionName) {
        return beginDeleteWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1<ServiceResponse<Void>, Void>() {
            @Override
            public Void call(ServiceResponse<Void> response) {
                return response.body();
            }
        });
    }

    /**
     * Delete an event subscription.
     * Delete an existing event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceResponse} object if successful.
     */
    public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String scope, String eventSubscriptionName) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.beginDelete(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                @Override
                public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Void> clientResponse = beginDeleteDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionInner object if successful.
     */
    public EventSubscriptionInner update(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().last().body();
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionInner> updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback<EventSubscriptionInner> serviceCallback) {
        return ServiceFuture.fromResponse(updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback);
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<EventSubscriptionInner> updateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1<ServiceResponse<EventSubscriptionInner>, EventSubscriptionInner>() {
            @Override
            public EventSubscriptionInner call(ServiceResponse<EventSubscriptionInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
    public Observable<ServiceResponse<EventSubscriptionInner>> updateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (eventSubscriptionUpdateParameters == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        Validator.validate(eventSubscriptionUpdateParameters);
        Observable<Response<ResponseBody>> observable = service.update(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
        return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<EventSubscriptionInner>() { }.getType());
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionInner object if successful.
     */
    public EventSubscriptionInner beginUpdate(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().single().body();
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionInner> beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, final ServiceCallback<EventSubscriptionInner> serviceCallback) {
        return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters), serviceCallback);
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<EventSubscriptionInner> beginUpdateAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        return beginUpdateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).map(new Func1<ServiceResponse<EventSubscriptionInner>, EventSubscriptionInner>() {
            @Override
            public EventSubscriptionInner call(ServiceResponse<EventSubscriptionInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Update an event subscription.
     * Asynchronously updates an existing event subscription.
     *
     * @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription to be updated.
     * @param eventSubscriptionUpdateParameters Updated event subscription information.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionInner object
     */
    public Observable<ServiceResponse<EventSubscriptionInner>> beginUpdateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (eventSubscriptionUpdateParameters == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        Validator.validate(eventSubscriptionUpdateParameters);
        return service.beginUpdate(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EventSubscriptionInner>>>() {
                @Override
                public Observable<ServiceResponse<EventSubscriptionInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<EventSubscriptionInner> clientResponse = beginUpdateDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Get full URL of an event subscription.
     * Get the full endpoint URL for an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the EventSubscriptionFullUrlInner object if successful.
     */
    public EventSubscriptionFullUrlInner getFullUrl(String scope, String eventSubscriptionName) {
        return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).toBlocking().single().body();
    }

    /**
     * Get full URL of an event subscription.
     * Get the full endpoint URL for an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<EventSubscriptionFullUrlInner> getFullUrlAsync(String scope, String eventSubscriptionName, final ServiceCallback<EventSubscriptionFullUrlInner> serviceCallback) {
        return ServiceFuture.fromResponse(getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName), serviceCallback);
    }

    /**
     * Get full URL of an event subscription.
     * Get the full endpoint URL for an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionFullUrlInner object
     */
    public Observable<EventSubscriptionFullUrlInner> getFullUrlAsync(String scope, String eventSubscriptionName) {
        return getFullUrlWithServiceResponseAsync(scope, eventSubscriptionName).map(new Func1<ServiceResponse<EventSubscriptionFullUrlInner>, EventSubscriptionFullUrlInner>() {
            @Override
            public EventSubscriptionFullUrlInner call(ServiceResponse<EventSubscriptionFullUrlInner> response) {
                return response.body();
            }
        });
    }

    /**
     * Get full URL of an event subscription.
     * Get the full endpoint URL for an event subscription.
     *
     * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
     * @param eventSubscriptionName Name of the event subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the EventSubscriptionFullUrlInner object
     */
    public Observable<ServiceResponse<EventSubscriptionFullUrlInner>> getFullUrlWithServiceResponseAsync(String scope, String eventSubscriptionName) {
        if (scope == null) {
            throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
        }
        if (eventSubscriptionName == null) {
            throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.getFullUrl(scope, eventSubscriptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EventSubscriptionFullUrlInner>>>() {
                @Override
                public Observable<ServiceResponse<EventSubscriptionFullUrlInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<EventSubscriptionFullUrlInner> clientResponse = getFullUrlDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> list() {
        ServiceResponse<Page<EventSubscriptionInner>> response = listSinglePageAsync().toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listAsync(final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listSinglePageAsync(),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listWithServiceResponseAsync() {
        return listSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listSinglePageAsync() {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> list(final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listSinglePageAsync(filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listAsync(final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listSinglePageAsync(filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listAsync(final String filter, final Integer top) {
        return listWithServiceResponseAsync(filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listWithServiceResponseAsync(final String filter, final Integer top) {
        return listSinglePageAsync(filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listSinglePageAsync(final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalBySubscriptionForTopicType(final String topicTypeName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName) {
        return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName) {
        return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalBySubscriptionForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalBySubscriptionForTopicType(final String topicTypeName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeAsync(final String topicTypeName, final String filter, final Integer top) {
        return listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(topicTypeName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeWithServiceResponseAsync(final String topicTypeName, final String filter, final Integer top) {
        return listGlobalBySubscriptionForTopicTypeSinglePageAsync(topicTypeName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param topicTypeName Name of the topic type.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeSinglePageAsync(final String topicTypeName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listGlobalBySubscriptionForTopicType(this.client.subscriptionId(), topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalBySubscriptionForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResourceGroup(final String resourceGroupName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceGroupSinglePageAsync(resourceGroupName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceGroupAsync(final String resourceGroupName) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
        return listByResourceGroupSinglePageAsync(resourceGroupName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceGroupDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResourceGroup(final String resourceGroupName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceGroupSinglePageAsync(resourceGroupName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) {
        return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceGroupDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName) {
        return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName) {
        return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalByResourceGroupForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalByResourceGroupForTopicType(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) {
        return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) {
        return listGlobalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, topicTypeName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param topicTypeName Name of the topic type.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String topicTypeName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listGlobalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalByResourceGroupForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscription(final String location) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionSinglePageAsync(location).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionAsync(final String location, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionSinglePageAsync(location),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionAsync(final String location) {
        return listRegionalBySubscriptionWithServiceResponseAsync(location)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionWithServiceResponseAsync(final String location) {
        return listRegionalBySubscriptionSinglePageAsync(location)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionSinglePageAsync(final String location) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscription(final String location, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionSinglePageAsync(location, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionSinglePageAsync(location, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionAsync(final String location, final String filter, final Integer top) {
        return listRegionalBySubscriptionWithServiceResponseAsync(location, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionWithServiceResponseAsync(final String location, final String filter, final Integer top) {
        return listRegionalBySubscriptionSinglePageAsync(location, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param location Name of the location.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionSinglePageAsync(final String location, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listRegionalBySubscription(this.client.subscriptionId(), location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroup(final String resourceGroupName, final String location) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location) {
        return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location) {
        return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroup(final String resourceGroupName, final String location, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupAsync(final String resourceGroupName, final String location, final String filter, final Integer top) {
        return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String location, final String filter, final Integer top) {
        return listRegionalByResourceGroupSinglePageAsync(resourceGroupName, location, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param location Name of the location.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupSinglePageAsync(final String resourceGroupName, final String location, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listRegionalByResourceGroup(this.client.subscriptionId(), resourceGroupName, location, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName) {
        return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName) {
        return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscriptionForTopicType(final String location, final String topicTypeName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(final String location, final String topicTypeName, final String filter, final Integer top) {
        return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(final String location, final String topicTypeName, final String filter, final Integer top) {
        return listRegionalBySubscriptionForTopicTypeSinglePageAsync(location, topicTypeName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param location Name of the location.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param topicTypeName Name of the topic type.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeSinglePageAsync(final String location, final String topicTypeName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listRegionalBySubscriptionForTopicType(this.client.subscriptionId(), location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName) {
        return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName) {
        return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroupForTopicType(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) {
        return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param location Name of the location.
     * @param topicTypeName Name of the topic type.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) {
        return listRegionalByResourceGroupForTopicTypeSinglePageAsync(resourceGroupName, location, topicTypeName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param location Name of the location.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param topicTypeName Name of the topic type.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeSinglePageAsync(final String resourceGroupName, final String location, final String topicTypeName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listRegionalByResourceGroupForTopicType(this.client.subscriptionId(), resourceGroupName, location, topicTypeName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupForTopicTypeDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) {
        return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) {
        return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (providerNamespace == null) {
            throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.");
        }
        if (resourceTypeName == null) {
            throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null.");
        }
        if (resourceName == null) {
            throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResource(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) {
        return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param providerNamespace Namespace of the provider of the topic.
     * @param resourceTypeName Name of the resource type.
     * @param resourceName Name of the resource.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceWithServiceResponseAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) {
        return listByResourceSinglePageAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param providerNamespace Namespace of the provider of the topic.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceTypeName Name of the resource type.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceName Name of the resource.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceSinglePageAsync(final String resourceGroupName, final String providerNamespace, final String resourceTypeName, final String resourceName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (providerNamespace == null) {
            throw new IllegalArgumentException("Parameter providerNamespace is required and cannot be null.");
        }
        if (resourceTypeName == null) {
            throw new IllegalArgumentException("Parameter resourceTypeName is required and cannot be null.");
        }
        if (resourceName == null) {
            throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listByResource(this.client.subscriptionId(), resourceGroupName, providerNamespace, resourceTypeName, resourceName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByDomainTopicNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName) {
        return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName) {
        return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (domainName == null) {
            throw new IllegalArgumentException("Parameter domainName is required and cannot be null.");
        }
        if (topicName == null) {
            throw new IllegalArgumentException("Parameter topicName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String filter = null;
        final Integer top = null;
        return service.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByDomainTopicDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByDomainTopic(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByDomainTopicNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByDomainTopicAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) {
        return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName, filter, top)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param resourceGroupName The name of the resource group within the user's subscription.
     * @param domainName Name of the top level domain.
     * @param topicName Name of the domain topic.
     * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
     * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicWithServiceResponseAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) {
        return listByDomainTopicSinglePageAsync(resourceGroupName, domainName, topicName, filter, top)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param resourceGroupName The name of the resource group within the user's subscription.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param domainName Name of the top level domain.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param topicName Name of the domain topic.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicSinglePageAsync(final String resourceGroupName, final String domainName, final String topicName, final String filter, final Integer top) {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (resourceGroupName == null) {
            throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
        }
        if (domainName == null) {
            throw new IllegalArgumentException("Parameter domainName is required and cannot be null.");
        }
        if (topicName == null) {
            throw new IllegalArgumentException("Parameter topicName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listByDomainTopic(this.client.subscriptionId(), resourceGroupName, domainName, topicName, this.client.apiVersion(), filter, top, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByDomainTopicDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listNextAsync(final String nextPageLink) {
        return listNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {
        return listNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * Get an aggregated list of all global event subscriptions under an Azure subscription.
     * List all aggregated global event subscriptions under a specific Azure subscription.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listNextSinglePageAsync(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.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalBySubscriptionForTopicTypeNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) {
        return listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) {
        return listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions for a topic type.
     * List all global event subscriptions under an Azure subscription for a topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalBySubscriptionForTopicTypeNextSinglePageAsync(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.listGlobalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalBySubscriptionForTopicTypeNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResourceGroupNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceGroupNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceGroupNextAsync(final String nextPageLink) {
        return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) {
        return listByResourceGroupNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under an Azure subscription and resource group.
     * List all global event subscriptions under a specific Azure subscription and resource group.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceGroupNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listGlobalByResourceGroupForTopicTypeNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) {
        return listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) {
        return listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listGlobalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all global event subscriptions under a resource group for a topic type.
     * List all global event subscriptions under a resource group for a specific topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listGlobalByResourceGroupForTopicTypeNextSinglePageAsync(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.listGlobalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listGlobalByResourceGroupForTopicTypeNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscriptionNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionNextAsync(final String nextPageLink) {
        return listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionNextWithServiceResponseAsync(final String nextPageLink) {
        return listRegionalBySubscriptionNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription.
     * List all event subscriptions from the given location under a specific Azure subscription.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionNextSinglePageAsync(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.listRegionalBySubscriptionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroupNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupNextAsync(final String nextPageLink) {
        return listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) {
        return listRegionalByResourceGroupNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupNextSinglePageAsync(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.listRegionalByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalBySubscriptionForTopicTypeNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeNextAsync(final String nextPageLink) {
        return listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) {
        return listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalBySubscriptionForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalBySubscriptionForTopicTypeNextSinglePageAsync(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.listRegionalBySubscriptionForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalBySubscriptionForTopicTypeNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listRegionalByResourceGroupForTopicTypeNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeNextAsync(final String nextPageLink) {
        return listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(final String nextPageLink) {
        return listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listRegionalByResourceGroupForTopicTypeNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all regional event subscriptions under an Azure subscription and resource group for a topic type.
     * List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listRegionalByResourceGroupForTopicTypeNextSinglePageAsync(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.listRegionalByResourceGroupForTopicTypeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listRegionalByResourceGroupForTopicTypeNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByResourceNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByResourceNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByResourceNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByResourceNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByResourceNextAsync(final String nextPageLink) {
        return listByResourceNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceNextWithServiceResponseAsync(final String nextPageLink) {
        return listByResourceNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByResourceNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific topic.
     * List all event subscriptions that have been created for a specific topic.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByResourceNextSinglePageAsync(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.listByResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByResourceNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @throws CloudException thrown if the request is rejected by server
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
     * @return the PagedList&lt;EventSubscriptionInner&gt; object if successful.
     */
    public PagedList<EventSubscriptionInner> listByDomainTopicNext(final String nextPageLink) {
        ServiceResponse<Page<EventSubscriptionInner>> response = listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single();
        return new PagedList<EventSubscriptionInner>(response.body()) {
            @Override
            public Page<EventSubscriptionInner> nextPage(String nextPageLink) {
                return listByDomainTopicNextSinglePageAsync(nextPageLink).toBlocking().single().body();
            }
        };
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @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.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the {@link ServiceFuture} object
     */
    public ServiceFuture<List<EventSubscriptionInner>> listByDomainTopicNextAsync(final String nextPageLink, final ServiceFuture<List<EventSubscriptionInner>> serviceFuture, final ListOperationCallback<EventSubscriptionInner> serviceCallback) {
        return AzureServiceFuture.fromPageResponse(
            listByDomainTopicNextSinglePageAsync(nextPageLink),
            new Func1<String, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(String nextPageLink) {
                    return listByDomainTopicNextSinglePageAsync(nextPageLink);
                }
            },
            serviceCallback);
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<Page<EventSubscriptionInner>> listByDomainTopicNextAsync(final String nextPageLink) {
        return listByDomainTopicNextWithServiceResponseAsync(nextPageLink)
            .map(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Page<EventSubscriptionInner>>() {
                @Override
                public Page<EventSubscriptionInner> call(ServiceResponse<Page<EventSubscriptionInner>> response) {
                    return response.body();
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the PagedList&lt;EventSubscriptionInner&gt; object
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicNextWithServiceResponseAsync(final String nextPageLink) {
        return listByDomainTopicNextSinglePageAsync(nextPageLink)
            .concatMap(new Func1<ServiceResponse<Page<EventSubscriptionInner>>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(ServiceResponse<Page<EventSubscriptionInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listByDomainTopicNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }

    /**
     * List all event subscriptions for a specific domain topic.
     * List all event subscriptions that have been created for a specific domain topic.
     *
    ServiceResponse<PageImpl<EventSubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the PagedList&lt;EventSubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
     */
    public Observable<ServiceResponse<Page<EventSubscriptionInner>>> listByDomainTopicNextSinglePageAsync(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.listByDomainTopicNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<EventSubscriptionInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<EventSubscriptionInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventSubscriptionInner>> result = listByDomainTopicNextDelegate(response);
                        return Observable.just(new ServiceResponse<Page<EventSubscriptionInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }

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

}
