From fa99ee7e896395ae05e74a25592c88cd91aa1c41 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 31 Oct 2018 20:44:17 +0000 Subject: [PATCH] Generated from b77f5d1a2652b84a016c368bff34ec26940facac Update DatabaseVulnerabilityAssessmentListByDatabase.json --- .../DatabaseVulnerabilityAssessment.java | 38 ++- ...nagedDatabaseVulnerabilityAssessments.java | 12 + .../DatabaseVulnerabilityAssessmentImpl.java | 12 +- .../DatabaseVulnerabilityAssessmentInner.java | 17 +- ...dDatabaseVulnerabilityAssessmentsImpl.java | 19 ++ ...DatabaseVulnerabilityAssessmentsInner.java | 256 ++++++++++++++++++ 6 files changed, 326 insertions(+), 28 deletions(-) diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java index 82e299cd0b656..99f5c0fc35596 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java @@ -60,7 +60,7 @@ public interface DatabaseVulnerabilityAssessment extends HasInner, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerSasKey { + interface WithCreate extends Creatable, DefinitionStages.WithRecurringScans, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageContainerPath, DefinitionStages.WithStorageContainerSasKey { } } /** * The template for a DatabaseVulnerabilityAssessment update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerSasKey { + interface Update extends Appliable, UpdateStages.WithRecurringScans, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageContainerPath, UpdateStages.WithStorageContainerSasKey { } /** @@ -161,6 +161,16 @@ interface WithStorageAccountAccessKey { Update withStorageAccountAccessKey(String storageAccountAccessKey); } + /** + * The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerPath. + */ + interface WithStorageContainerPath { + /** + * Specifies storageContainerPath. + */ + Update withStorageContainerPath(String storageContainerPath); + } + /** * The stage of the databasevulnerabilityassessment update allowing to specify StorageContainerSasKey. */ diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedDatabaseVulnerabilityAssessments.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedDatabaseVulnerabilityAssessments.java index a968416a939b3..35276f5bcae88 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedDatabaseVulnerabilityAssessments.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedDatabaseVulnerabilityAssessments.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.sql.v2017_10_01_preview; import rx.Observable; +import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment; import rx.Completable; /** @@ -33,6 +34,17 @@ public interface ManagedDatabaseVulnerabilityAssessments { */ Observable getAsync(String resourceGroupName, String managedInstanceName, String databaseName); + /** + * Lists the vulnerability assessments of a managed database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName); + /** * Removes the database's vulnerability assessment. * diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentImpl.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentImpl.java index 809982bc6711a..a8c311ee04fd6 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentImpl.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentImpl.java @@ -113,12 +113,6 @@ public DatabaseVulnerabilityAssessmentImpl withExistingDatabasis(String resource return this; } - @Override - public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) { - this.inner().withStorageContainerPath(storageContainerPath); - return this; - } - @Override public DatabaseVulnerabilityAssessmentImpl withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans) { this.inner().withRecurringScans(recurringScans); @@ -131,6 +125,12 @@ public DatabaseVulnerabilityAssessmentImpl withStorageAccountAccessKey(String st return this; } + @Override + public DatabaseVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) { + this.inner().withStorageContainerPath(storageContainerPath); + return this; + } + @Override public DatabaseVulnerabilityAssessmentImpl withStorageContainerSasKey(String storageContainerSasKey) { this.inner().withStorageContainerSasKey(storageContainerSasKey); diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java index ca0d10de1ccc2..fecaa4caac857 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java @@ -20,9 +20,10 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource { /** * A blob storage container path to hold the scan results (e.g. - * https://myStorage.blob.core.windows.net/VaScans/). + * https://myStorage.blob.core.windows.net/VaScans/). It is required if + * server level vulnerability assessment policy doesn't set. */ - @JsonProperty(value = "properties.storageContainerPath", required = true) + @JsonProperty(value = "properties.storageContainerPath") private String storageContainerPath; /** @@ -35,8 +36,8 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource { private String storageContainerSasKey; /** - * Specifies the identifier key of the vulnerability assessment storage - * account. If 'StorageContainerSasKey' isn't specified, + * Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, * storageAccountAccessKey is required. */ @JsonProperty(value = "properties.storageAccountAccessKey") @@ -49,7 +50,7 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource { private VulnerabilityAssessmentRecurringScansProperties recurringScans; /** - * Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). + * Get a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set. * * @return the storageContainerPath value */ @@ -58,7 +59,7 @@ public String storageContainerPath() { } /** - * Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). + * Set a blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set. * * @param storageContainerPath the storageContainerPath value to set * @return the DatabaseVulnerabilityAssessmentInner object itself. @@ -89,7 +90,7 @@ public DatabaseVulnerabilityAssessmentInner withStorageContainerSasKey(String st } /** - * Get specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * Get specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. * * @return the storageAccountAccessKey value */ @@ -98,7 +99,7 @@ public String storageAccountAccessKey() { } /** - * Set specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * Set specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. * * @param storageAccountAccessKey the storageAccountAccessKey value to set * @return the DatabaseVulnerabilityAssessmentInner object itself. diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java index 2aebef01be627..601d891194640 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java @@ -14,6 +14,7 @@ import rx.Observable; import rx.functions.Func1; import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessment; +import com.microsoft.azure.Page; import rx.Completable; class ManagedDatabaseVulnerabilityAssessmentsImpl extends WrapperImpl implements ManagedDatabaseVulnerabilityAssessments { @@ -61,6 +62,24 @@ public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner }); } + @Override + public Observable listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) { + ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner(); + return client.listByDatabaseAsync(resourceGroupName, managedInstanceName, databaseName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner inner) { + return wrapDatabaseVulnerabilityAssessmentModel(inner); + } + }); + } + @Override public Completable deleteAsync(String resourceGroupName, String managedInstanceName, String databaseName) { ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner(); diff --git a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsInner.java b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsInner.java index cb03c78870d60..26a44afc9a785 100644 --- a/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsInner.java +++ b/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsInner.java @@ -10,12 +10,17 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.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; @@ -25,6 +30,7 @@ import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -67,6 +73,14 @@ interface ManagedDatabaseVulnerabilityAssessmentsService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("vulnerabilityAssessmentName") String vulnerabilityAssessmentName, @Path("subscriptionId") String subscriptionId, @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.sql.v2017_10_01_preview.ManagedDatabaseVulnerabilityAssessments listByDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments") + Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @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.sql.v2017_10_01_preview.ManagedDatabaseVulnerabilityAssessments listByDatabaseNext" }) + @GET + Observable> listByDatabaseNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -359,4 +373,246 @@ private ServiceResponse deleteDelegate(Response response) th .build(response); } + /** + * Lists the vulnerability assessments of a managed database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @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<DatabaseVulnerabilityAssessmentInner> object if successful. + */ + public PagedList listByDatabase(final String resourceGroupName, final String managedInstanceName, final String databaseName) { + ServiceResponse> response = listByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDatabaseNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @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> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDatabaseNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatabaseVulnerabilityAssessmentInner> object + */ + public Observable> listByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DatabaseVulnerabilityAssessmentInner> object + */ + public Observable>> listByDatabaseWithServiceResponseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) { + return listByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName) + .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(listByDatabaseNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param managedInstanceName The name of the managed instance. + ServiceResponse> * @param databaseName The name of the database for which the vulnerability assessment is defined. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseVulnerabilityAssessmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDatabaseSinglePageAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + 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.listByDatabase(resourceGroupName, managedInstanceName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDatabaseDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @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<DatabaseVulnerabilityAssessmentInner> object if successful. + */ + public PagedList listByDatabaseNext(final String nextPageLink) { + ServiceResponse> response = listByDatabaseNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDatabaseNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @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> listByDatabaseNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDatabaseNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDatabaseNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @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<DatabaseVulnerabilityAssessmentInner> object + */ + public Observable> listByDatabaseNextAsync(final String nextPageLink) { + return listByDatabaseNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + * @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<DatabaseVulnerabilityAssessmentInner> object + */ + public Observable>> listByDatabaseNextWithServiceResponseAsync(final String nextPageLink) { + return listByDatabaseNextSinglePageAsync(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(listByDatabaseNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the vulnerability assessments of a managed database. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseVulnerabilityAssessmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDatabaseNextSinglePageAsync(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.listByDatabaseNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDatabaseNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDatabaseNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + }