From 006ab14e2e6c1425c14a65dda83ff9a81d9c046f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 16 Aug 2018 21:55:08 +0000 Subject: [PATCH] Generated from 6b8368dd434d71e004539fe305ae2c2c9cc100a3 Removed QueryConnectionMonitors API --- .../network/v2018_06_01/NetworkWatchers.java | 10 - .../implementation/NetworkWatchersImpl.java | 19 - .../implementation/NetworkWatchersInner.java | 738 ------------------ 3 files changed, 767 deletions(-) diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java index 0255bf43ad15..f569672a812b 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/NetworkWatchers.java @@ -155,14 +155,4 @@ public interface NetworkWatchers extends SupportsCreating getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName); - } diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java index 037d43dd27d2..53af037b2e3c 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersImpl.java @@ -32,7 +32,6 @@ import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReport; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersList; import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticResponse; -import com.microsoft.azure.management.network.v2018_06_01.ConnectionMonitorsQueryResultItem; import com.microsoft.azure.management.network.v2018_06_01.TopologyParameters; import com.microsoft.azure.management.network.v2018_06_01.VerificationIPFlowParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; @@ -288,24 +287,6 @@ public NetworkConfigurationDiagnosticResponse call(NetworkConfigurationDiagnosti }); } - @Override - public Observable queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { - NetworkWatchersInner client = this.inner(); - return client.queryConnectionMonitorsAsync(resourceGroupName, networkWatcherName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public ConnectionMonitorsQueryResultItem call(ConnectionMonitorsQueryResultItemInner inner) { - return new ConnectionMonitorsQueryResultItemImpl(inner, manager()); - } - }); - } - @Override protected NetworkWatcherImpl wrapModel(NetworkWatcherInner inner) { return new NetworkWatcherImpl(inner.name(), inner, manager()); diff --git a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java index ee07621cba7b..17ff5136b449 100644 --- a/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java +++ b/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkWatchersInner.java @@ -13,8 +13,6 @@ 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.ListOperationCallback; import com.microsoft.azure.management.network.v2018_06_01.AvailableProvidersListParameters; import com.microsoft.azure.management.network.v2018_06_01.AzureReachabilityReportParameters; import com.microsoft.azure.management.network.v2018_06_01.ConnectivityParameters; @@ -22,7 +20,6 @@ import com.microsoft.azure.management.network.v2018_06_01.FlowLogStatusParameters; import com.microsoft.azure.management.network.v2018_06_01.NetworkConfigurationDiagnosticParameters; import com.microsoft.azure.management.network.v2018_06_01.NextHopParameters; -import com.microsoft.azure.management.network.v2018_06_01.QueryConnectionMonitorsParameters; import com.microsoft.azure.management.network.v2018_06_01.QueryTroubleshootingParameters; import com.microsoft.azure.management.network.v2018_06_01.SecurityGroupViewParameters; import com.microsoft.azure.management.network.v2018_06_01.TagsObject; @@ -49,7 +46,6 @@ 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; @@ -200,22 +196,6 @@ interface NetworkWatchersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") Observable> beginGetNetworkConfigurationDiagnostic(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Body NetworkConfigurationDiagnosticParameters parameters, @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.network.v2018_06_01.NetworkWatchers queryConnectionMonitors" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors") - Observable> queryConnectionMonitors(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryConnectionMonitorsParameters parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers beginQueryConnectionMonitors" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors") - Observable> beginQueryConnectionMonitors(@Path("resourceGroupName") String resourceGroupName, @Path("networkWatcherName") String networkWatcherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueryConnectionMonitorsParameters parameters, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2018_06_01.NetworkWatchers queryConnectionMonitorsNext" }) - @GET - Observable> queryConnectionMonitorsNext(@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.network.v2018_06_01.NetworkWatchers beginQueryConnectionMonitorsNext" }) - @GET - Observable> beginQueryConnectionMonitorsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - } /** @@ -2827,722 +2807,4 @@ private ServiceResponse beginGetNet .build(response); } - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList queryConnectionMonitors(final String resourceGroupName, final String networkWatcherName) { - ServiceResponse> response = queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @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> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { - return queryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> queryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName) { - return queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> queryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (networkWatcherName == null) { - throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - final String apiVersion = "2018-06-01"; - final List connectionMonitorIds = null; - QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); - parameters.withConnectionMonitorIds(null); - return service.queryConnectionMonitors(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = queryConnectionMonitorsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList queryConnectionMonitors(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - ServiceResponse> response = queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @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> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> queryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - return queryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> queryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - return queryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - ServiceResponse> * @param resourceGroupName The name of the resource group. - ServiceResponse> * @param networkWatcherName The name of the network watcher. - ServiceResponse> * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> queryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (networkWatcherName == null) { - throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - Validator.validate(connectionMonitorIds); - final String apiVersion = "2018-06-01"; - QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); - parameters.withConnectionMonitorIds(connectionMonitorIds); - return service.queryConnectionMonitors(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = queryConnectionMonitorsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> queryConnectionMonitorsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException, InterruptedException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .register(202, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList beginQueryConnectionMonitors(final String resourceGroupName, final String networkWatcherName) { - ServiceResponse> response = beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @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> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName) { - return beginQueryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> beginQueryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName) { - return beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> beginQueryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (networkWatcherName == null) { - throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - final String apiVersion = "2018-06-01"; - final List connectionMonitorIds = null; - QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); - parameters.withConnectionMonitorIds(null); - return service.beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = beginQueryConnectionMonitorsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList beginQueryConnectionMonitors(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - ServiceResponse> response = beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @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> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> beginQueryConnectionMonitorsAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - return beginQueryConnectionMonitorsWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @param resourceGroupName The name of the resource group. - * @param networkWatcherName The name of the network watcher. - * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> beginQueryConnectionMonitorsWithServiceResponseAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - return beginQueryConnectionMonitorsSinglePageAsync(resourceGroupName, networkWatcherName, connectionMonitorIds) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - ServiceResponse> * @param resourceGroupName The name of the resource group. - ServiceResponse> * @param networkWatcherName The name of the network watcher. - ServiceResponse> * @param connectionMonitorIds List of connection monitors ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> beginQueryConnectionMonitorsSinglePageAsync(final String resourceGroupName, final String networkWatcherName, final List connectionMonitorIds) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (networkWatcherName == null) { - throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - Validator.validate(connectionMonitorIds); - final String apiVersion = "2018-06-01"; - QueryConnectionMonitorsParameters parameters = new QueryConnectionMonitorsParameters(); - parameters.withConnectionMonitorIds(connectionMonitorIds); - return service.beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = beginQueryConnectionMonitorsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> beginQueryConnectionMonitorsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .register(202, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - - /** - * Query connection monitors. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList queryConnectionMonitorsNext(final String nextPageLink) { - ServiceResponse> response = queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @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> queryConnectionMonitorsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - queryConnectionMonitorsNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @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<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> queryConnectionMonitorsNextAsync(final String nextPageLink) { - return queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @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<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> queryConnectionMonitorsNextWithServiceResponseAsync(final String nextPageLink) { - return queryConnectionMonitorsNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(queryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> queryConnectionMonitorsNextSinglePageAsync(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.queryConnectionMonitorsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = queryConnectionMonitorsNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> queryConnectionMonitorsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException, InterruptedException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .register(202, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - - /** - * Query connection monitors. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException 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<ConnectionMonitorsQueryResultItemInner> object if successful. - */ - public PagedList beginQueryConnectionMonitorsNext(final String nextPageLink) { - ServiceResponse> response = beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Query connection monitors. - * - * @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> beginQueryConnectionMonitorsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Query connection monitors. - * - * @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<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable> beginQueryConnectionMonitorsNextAsync(final String nextPageLink) { - return beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Query connection monitors. - * - * @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<ConnectionMonitorsQueryResultItemInner> object - */ - public Observable>> beginQueryConnectionMonitorsNextWithServiceResponseAsync(final String nextPageLink) { - return beginQueryConnectionMonitorsNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(beginQueryConnectionMonitorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Query connection monitors. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ConnectionMonitorsQueryResultItemInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> beginQueryConnectionMonitorsNextSinglePageAsync(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.beginQueryConnectionMonitorsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = beginQueryConnectionMonitorsNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> beginQueryConnectionMonitorsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .register(202, new TypeToken>() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - }