From e9cff208ff415fba3172a5ef52e17019b773632c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 23 Mar 2018 01:55:30 +0000 Subject: [PATCH 1/2] Generated from 004b779037b0746e70800d916c474aa58e830ced Moving files into 2015 api folder --- .../LongTermRetentionBackupsInner.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LongTermRetentionBackupsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LongTermRetentionBackupsInner.java index 769f44cdb54..307322f49d6 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LongTermRetentionBackupsInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LongTermRetentionBackupsInner.java @@ -13,7 +13,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.sql.DatabaseState; +import com.microsoft.azure.management.sql.LongTermRetentionDatabaseState; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -73,15 +73,15 @@ interface LongTermRetentionBackupsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.LongTermRetentionBackups listByDatabase" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups") - Observable> listByDatabase(@Path("locationName") String locationName, @Path("longTermRetentionServerName") String longTermRetentionServerName, @Path("longTermRetentionDatabaseName") String longTermRetentionDatabaseName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") DatabaseState databaseState, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByDatabase(@Path("locationName") String locationName, @Path("longTermRetentionServerName") String longTermRetentionServerName, @Path("longTermRetentionDatabaseName") String longTermRetentionDatabaseName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") LongTermRetentionDatabaseState databaseState, @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.LongTermRetentionBackups listByLocation" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups") - Observable> listByLocation(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") DatabaseState databaseState, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByLocation(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") LongTermRetentionDatabaseState databaseState, @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.LongTermRetentionBackups listByServer" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups") - Observable> listByServer(@Path("locationName") String locationName, @Path("longTermRetentionServerName") String longTermRetentionServerName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") DatabaseState databaseState, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByServer(@Path("locationName") String locationName, @Path("longTermRetentionServerName") String longTermRetentionServerName, @Path("subscriptionId") String subscriptionId, @Query("onlyLatestPerDatabase") Boolean onlyLatestPerDatabase, @Query("databaseState") LongTermRetentionDatabaseState databaseState, @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.LongTermRetentionBackups listByDatabaseNext" }) @GET @@ -482,7 +482,7 @@ public Observable>> listByDat } final String apiVersion = "2017-03-01-preview"; final Boolean onlyLatestPerDatabase = null; - final DatabaseState databaseState = null; + final LongTermRetentionDatabaseState databaseState = null; return service.listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, this.client.subscriptionId(), onlyLatestPerDatabase, databaseState, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -510,7 +510,7 @@ public Observable>> call(Resp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<LongTermRetentionBackupInner> object if successful. */ - public PagedList listByDatabase(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public PagedList listByDatabase(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { ServiceResponse> response = listByDatabaseSinglePageAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState).toBlocking().single(); return new PagedList(response.body()) { @Override @@ -532,7 +532,7 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByDatabaseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByDatabaseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByDatabaseSinglePageAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState), new Func1>>>() { @@ -555,7 +555,7 @@ public Observable>> call(Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<LongTermRetentionBackupInner> object */ - public Observable> listByDatabaseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable> listByDatabaseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByDatabaseWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) .map(new Func1>, Page>() { @Override @@ -576,7 +576,7 @@ public Page call(ServiceResponse>> listByDatabaseWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByDatabaseWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByDatabaseSinglePageAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, onlyLatestPerDatabase, databaseState) .concatMap(new Func1>, Observable>>>() { @Override @@ -601,7 +601,7 @@ public Observable>> call(Serv * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<LongTermRetentionBackupInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByDatabaseSinglePageAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByDatabaseSinglePageAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { if (locationName == null) { throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); } @@ -729,7 +729,7 @@ public Observable>> listByLoc } final String apiVersion = "2017-03-01-preview"; final Boolean onlyLatestPerDatabase = null; - final DatabaseState databaseState = null; + final LongTermRetentionDatabaseState databaseState = null; return service.listByLocation(locationName, this.client.subscriptionId(), onlyLatestPerDatabase, databaseState, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -755,7 +755,7 @@ public Observable>> call(Resp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<LongTermRetentionBackupInner> object if successful. */ - public PagedList listByLocation(final String locationName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public PagedList listByLocation(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { ServiceResponse> response = listByLocationSinglePageAsync(locationName, onlyLatestPerDatabase, databaseState).toBlocking().single(); return new PagedList(response.body()) { @Override @@ -775,7 +775,7 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByLocationSinglePageAsync(locationName, onlyLatestPerDatabase, databaseState), new Func1>>>() { @@ -796,7 +796,7 @@ public Observable>> call(Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<LongTermRetentionBackupInner> object */ - public Observable> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable> listByLocationAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByLocationWithServiceResponseAsync(locationName, onlyLatestPerDatabase, databaseState) .map(new Func1>, Page>() { @Override @@ -815,7 +815,7 @@ public Page call(ServiceResponse>> listByLocationWithServiceResponseAsync(final String locationName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByLocationWithServiceResponseAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByLocationSinglePageAsync(locationName, onlyLatestPerDatabase, databaseState) .concatMap(new Func1>, Observable>>>() { @Override @@ -838,7 +838,7 @@ public Observable>> call(Serv * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<LongTermRetentionBackupInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByLocationSinglePageAsync(final String locationName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByLocationSinglePageAsync(final String locationName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { if (locationName == null) { throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); } @@ -968,7 +968,7 @@ public Observable>> listBySer } final String apiVersion = "2017-03-01-preview"; final Boolean onlyLatestPerDatabase = null; - final DatabaseState databaseState = null; + final LongTermRetentionDatabaseState databaseState = null; return service.listByServer(locationName, longTermRetentionServerName, this.client.subscriptionId(), onlyLatestPerDatabase, databaseState, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -995,7 +995,7 @@ public Observable>> call(Resp * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<LongTermRetentionBackupInner> object if successful. */ - public PagedList listByServer(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public PagedList listByServer(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { ServiceResponse> response = listByServerSinglePageAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState).toBlocking().single(); return new PagedList(response.body()) { @Override @@ -1016,7 +1016,7 @@ public Page nextPage(String nextPageLink) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByServerAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByServerAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( listByServerSinglePageAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState), new Func1>>>() { @@ -1038,7 +1038,7 @@ public Observable>> call(Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<LongTermRetentionBackupInner> object */ - public Observable> listByServerAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable> listByServerAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByServerWithServiceResponseAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) .map(new Func1>, Page>() { @Override @@ -1058,7 +1058,7 @@ public Page call(ServiceResponse>> listByServerWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByServerWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { return listByServerSinglePageAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState) .concatMap(new Func1>, Observable>>>() { @Override @@ -1082,7 +1082,7 @@ public Observable>> call(Serv * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<LongTermRetentionBackupInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByServerSinglePageAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final DatabaseState databaseState) { + public Observable>> listByServerSinglePageAsync(final String locationName, final String longTermRetentionServerName, final Boolean onlyLatestPerDatabase, final LongTermRetentionDatabaseState databaseState) { if (locationName == null) { throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); } From 85ce65ff2acd52aa8b9fdae587479b2c7f42b0fd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 27 Mar 2018 21:50:53 +0000 Subject: [PATCH 2/2] Generated from b9c66e68409d6d1ea0c2873c7da0bc29a3f2fe2b Updating ReadMe as tests are recorded E2E --- .../azure/management/sql/CapabilityGroup.java | 44 + .../management/sql/CatalogCollationType.java | 41 + .../azure/management/sql/CreateMode.java | 24 +- .../management/sql/DatabaseLicenseType.java | 41 + .../management/sql/DatabaseReadScale.java | 41 + .../azure/management/sql/DatabaseStatus.java | 89 + .../management/sql/EditionCapability.java | 60 +- .../sql/ElasticPoolEditionCapability.java | 62 +- .../sql/ElasticPoolLicenseType.java | 41 + ...DatabaseMaxPerformanceLevelCapability.java | 106 + ...DatabaseMinPerformanceLevelCapability.java | 90 + .../sql/ElasticPoolPerDatabaseSettings.java | 69 + ...ElasticPoolPerformanceLevelCapability.java | 180 ++ .../management/sql/LicenseTypeCapability.java | 74 + .../management/sql/LogSizeCapability.java | 48 + .../azure/management/sql/LogSizeUnit.java | 50 + .../sql/ManagedInstanceEditionCapability.java | 90 + .../sql/ManagedInstanceFamilyCapability.java | 150 ++ .../sql/ManagedInstanceVcoresCapability.java | 89 + .../sql/ManagedInstanceVersionCapability.java | 90 + .../management/sql/MaxSizeCapability.java | 28 +- .../sql/MaxSizeRangeCapability.java | 120 + .../azure/management/sql/MaxSizeUnit.java | 47 + .../sql/PerformanceLevelCapability.java | 48 + .../management/sql/PerformanceLevelUnit.java | 43 +- .../azure/management/sql/SampleName.java | 6 + .../sql/ServerVersionCapability.java | 58 +- .../sql/ServiceObjectiveCapability.java | 130 +- .../microsoft/azure/management/sql/Sku.java | 148 ++ .../sql/implementation/CapabilitiesInner.java | 118 +- .../sql/implementation/DatabaseInner.java | 702 +++--- .../implementation/DatabaseUpdateInner.java | 695 +++--- .../sql/implementation/DatabasesInner.java | 1993 +++++++++-------- .../sql/implementation/ElasticPoolInner.java | 186 +- .../ElasticPoolUpdateInner.java | 200 +- .../sql/implementation/ElasticPoolsInner.java | 990 +++++--- .../LocationCapabilitiesInner.java | 64 +- .../RecommendedElasticPoolInner.java | 4 +- .../SqlManagementClientImpl.java | 112 +- 39 files changed, 4719 insertions(+), 2452 deletions(-) create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CapabilityGroup.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CatalogCollationType.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseLicenseType.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseReadScale.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseStatus.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolLicenseType.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMaxPerformanceLevelCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMinPerformanceLevelCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseSettings.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerformanceLevelCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LicenseTypeCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeUnit.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceEditionCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceFamilyCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVcoresCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVersionCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeRangeCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeUnit.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelCapability.java create mode 100644 azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/Sku.java diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CapabilityGroup.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CapabilityGroup.java new file mode 100644 index 00000000000..4b936587e57 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CapabilityGroup.java @@ -0,0 +1,44 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CapabilityGroup. + */ +public final class CapabilityGroup extends ExpandableStringEnum { + /** Static value supportedEditions for CapabilityGroup. */ + public static final CapabilityGroup SUPPORTED_EDITIONS = fromString("supportedEditions"); + + /** Static value supportedElasticPoolEditions for CapabilityGroup. */ + public static final CapabilityGroup SUPPORTED_ELASTIC_POOL_EDITIONS = fromString("supportedElasticPoolEditions"); + + /** Static value supportedManagedInstanceVersions for CapabilityGroup. */ + public static final CapabilityGroup SUPPORTED_MANAGED_INSTANCE_VERSIONS = fromString("supportedManagedInstanceVersions"); + + /** + * Creates or finds a CapabilityGroup from its string representation. + * @param name a name to look for + * @return the corresponding CapabilityGroup + */ + @JsonCreator + public static CapabilityGroup fromString(String name) { + return fromString(name, CapabilityGroup.class); + } + + /** + * @return known CapabilityGroup values + */ + public static Collection values() { + return values(CapabilityGroup.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CatalogCollationType.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CatalogCollationType.java new file mode 100644 index 00000000000..1d81eb673be --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CatalogCollationType.java @@ -0,0 +1,41 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CatalogCollationType. + */ +public final class CatalogCollationType extends ExpandableStringEnum { + /** Static value DATABASE_DEFAULT for CatalogCollationType. */ + public static final CatalogCollationType DATABASE_DEFAULT = fromString("DATABASE_DEFAULT"); + + /** Static value SQL_Latin1_General_CP1_CI_AS for CatalogCollationType. */ + public static final CatalogCollationType SQL_LATIN1_GENERAL_CP1_CI_AS = fromString("SQL_Latin1_General_CP1_CI_AS"); + + /** + * Creates or finds a CatalogCollationType from its string representation. + * @param name a name to look for + * @return the corresponding CatalogCollationType + */ + @JsonCreator + public static CatalogCollationType fromString(String name) { + return fromString(name, CatalogCollationType.class); + } + + /** + * @return known CatalogCollationType values + */ + public static Collection values() { + return values(CatalogCollationType.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CreateMode.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CreateMode.java index 1cb7cc3007c..075dab9a04c 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CreateMode.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/CreateMode.java @@ -16,30 +16,36 @@ * Defines values for CreateMode. */ public final class CreateMode extends ExpandableStringEnum { - /** Static value Copy for CreateMode. */ - public static final CreateMode COPY = fromString("Copy"); - /** Static value Default for CreateMode. */ public static final CreateMode DEFAULT = fromString("Default"); - /** Static value NonReadableSecondary for CreateMode. */ - public static final CreateMode NON_READABLE_SECONDARY = fromString("NonReadableSecondary"); + /** Static value Copy for CreateMode. */ + public static final CreateMode COPY = fromString("Copy"); - /** Static value OnlineSecondary for CreateMode. */ - public static final CreateMode ONLINE_SECONDARY = fromString("OnlineSecondary"); + /** Static value Secondary for CreateMode. */ + public static final CreateMode SECONDARY = fromString("Secondary"); /** Static value PointInTimeRestore for CreateMode. */ public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + /** Static value Restore for CreateMode. */ + public static final CreateMode RESTORE = fromString("Restore"); + /** Static value Recovery for CreateMode. */ public static final CreateMode RECOVERY = fromString("Recovery"); - /** Static value Restore for CreateMode. */ - public static final CreateMode RESTORE = fromString("Restore"); + /** Static value RestoreExternalBackup for CreateMode. */ + public static final CreateMode RESTORE_EXTERNAL_BACKUP = fromString("RestoreExternalBackup"); + + /** Static value RestoreExternalBackupSecondary for CreateMode. */ + public static final CreateMode RESTORE_EXTERNAL_BACKUP_SECONDARY = fromString("RestoreExternalBackupSecondary"); /** Static value RestoreLongTermRetentionBackup for CreateMode. */ public static final CreateMode RESTORE_LONG_TERM_RETENTION_BACKUP = fromString("RestoreLongTermRetentionBackup"); + /** Static value OnlineSecondary for CreateMode. */ + public static final CreateMode ONLINE_SECONDARY = fromString("OnlineSecondary"); + /** * Creates or finds a CreateMode from its string representation. * @param name a name to look for diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseLicenseType.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseLicenseType.java new file mode 100644 index 00000000000..a46023d1944 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseLicenseType.java @@ -0,0 +1,41 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseLicenseType. + */ +public final class DatabaseLicenseType extends ExpandableStringEnum { + /** Static value LicenseIncluded for DatabaseLicenseType. */ + public static final DatabaseLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); + + /** Static value BasePrice for DatabaseLicenseType. */ + public static final DatabaseLicenseType BASE_PRICE = fromString("BasePrice"); + + /** + * Creates or finds a DatabaseLicenseType from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseLicenseType + */ + @JsonCreator + public static DatabaseLicenseType fromString(String name) { + return fromString(name, DatabaseLicenseType.class); + } + + /** + * @return known DatabaseLicenseType values + */ + public static Collection values() { + return values(DatabaseLicenseType.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseReadScale.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseReadScale.java new file mode 100644 index 00000000000..ea7a1ebbb91 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseReadScale.java @@ -0,0 +1,41 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseReadScale. + */ +public final class DatabaseReadScale extends ExpandableStringEnum { + /** Static value Enabled for DatabaseReadScale. */ + public static final DatabaseReadScale ENABLED = fromString("Enabled"); + + /** Static value Disabled for DatabaseReadScale. */ + public static final DatabaseReadScale DISABLED = fromString("Disabled"); + + /** + * Creates or finds a DatabaseReadScale from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseReadScale + */ + @JsonCreator + public static DatabaseReadScale fromString(String name) { + return fromString(name, DatabaseReadScale.class); + } + + /** + * @return known DatabaseReadScale values + */ + public static Collection values() { + return values(DatabaseReadScale.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseStatus.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseStatus.java new file mode 100644 index 00000000000..5fd060527c4 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseStatus.java @@ -0,0 +1,89 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseStatus. + */ +public final class DatabaseStatus extends ExpandableStringEnum { + /** Static value Online for DatabaseStatus. */ + public static final DatabaseStatus ONLINE = fromString("Online"); + + /** Static value Restoring for DatabaseStatus. */ + public static final DatabaseStatus RESTORING = fromString("Restoring"); + + /** Static value RecoveryPending for DatabaseStatus. */ + public static final DatabaseStatus RECOVERY_PENDING = fromString("RecoveryPending"); + + /** Static value Recovering for DatabaseStatus. */ + public static final DatabaseStatus RECOVERING = fromString("Recovering"); + + /** Static value Suspect for DatabaseStatus. */ + public static final DatabaseStatus SUSPECT = fromString("Suspect"); + + /** Static value Offline for DatabaseStatus. */ + public static final DatabaseStatus OFFLINE = fromString("Offline"); + + /** Static value Standby for DatabaseStatus. */ + public static final DatabaseStatus STANDBY = fromString("Standby"); + + /** Static value Shutdown for DatabaseStatus. */ + public static final DatabaseStatus SHUTDOWN = fromString("Shutdown"); + + /** Static value EmergencyMode for DatabaseStatus. */ + public static final DatabaseStatus EMERGENCY_MODE = fromString("EmergencyMode"); + + /** Static value AutoClosed for DatabaseStatus. */ + public static final DatabaseStatus AUTO_CLOSED = fromString("AutoClosed"); + + /** Static value Copying for DatabaseStatus. */ + public static final DatabaseStatus COPYING = fromString("Copying"); + + /** Static value Creating for DatabaseStatus. */ + public static final DatabaseStatus CREATING = fromString("Creating"); + + /** Static value Inaccessible for DatabaseStatus. */ + public static final DatabaseStatus INACCESSIBLE = fromString("Inaccessible"); + + /** Static value OfflineSecondary for DatabaseStatus. */ + public static final DatabaseStatus OFFLINE_SECONDARY = fromString("OfflineSecondary"); + + /** Static value Pausing for DatabaseStatus. */ + public static final DatabaseStatus PAUSING = fromString("Pausing"); + + /** Static value Paused for DatabaseStatus. */ + public static final DatabaseStatus PAUSED = fromString("Paused"); + + /** Static value Resuming for DatabaseStatus. */ + public static final DatabaseStatus RESUMING = fromString("Resuming"); + + /** Static value Scaling for DatabaseStatus. */ + public static final DatabaseStatus SCALING = fromString("Scaling"); + + /** + * Creates or finds a DatabaseStatus from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseStatus + */ + @JsonCreator + public static DatabaseStatus fromString(String name) { + return fromString(name, DatabaseStatus.class); + } + + /** + * @return known DatabaseStatus values + */ + public static Collection values() { + return values(DatabaseStatus.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/EditionCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/EditionCapability.java index 718e110ab80..552411b2f3e 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/EditionCapability.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/EditionCapability.java @@ -12,22 +12,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The database edition capabilities. + * The edition capability. */ public class EditionCapability { /** - * The edition name. + * The database edition name. */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; - /** - * The status of the edition. Possible values include: 'Visible', - * 'Available', 'Default', 'Disabled'. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityStatus status; - /** * The list of supported service objectives for the edition. */ @@ -40,6 +33,19 @@ public class EditionCapability { @JsonProperty(value = "zoneRedundant", access = JsonProperty.Access.WRITE_ONLY) private Boolean zoneRedundant; + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + /** * Get the name value. * @@ -49,6 +55,24 @@ public String name() { return this.name; } + /** + * Get the supportedServiceLevelObjectives value. + * + * @return the supportedServiceLevelObjectives value + */ + public List supportedServiceLevelObjectives() { + return this.supportedServiceLevelObjectives; + } + + /** + * Get the zoneRedundant value. + * + * @return the zoneRedundant value + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + /** * Get the status value. * @@ -59,21 +83,23 @@ public CapabilityStatus status() { } /** - * Get the supportedServiceLevelObjectives value. + * Get the reason value. * - * @return the supportedServiceLevelObjectives value + * @return the reason value */ - public List supportedServiceLevelObjectives() { - return this.supportedServiceLevelObjectives; + public String reason() { + return this.reason; } /** - * Get the zoneRedundant value. + * Set the reason value. * - * @return the zoneRedundant value + * @param reason the reason value to set + * @return the EditionCapability object itself. */ - public Boolean zoneRedundant() { - return this.zoneRedundant; + public EditionCapability withReason(String reason) { + this.reason = reason; + return this; } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEditionCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEditionCapability.java index 31ad28b824d..2c41bbcf3b1 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEditionCapability.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEditionCapability.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The elastic pool edition capabilities. + * The elastic pool edition capability. */ public class ElasticPoolEditionCapability { /** @@ -21,18 +21,11 @@ public class ElasticPoolEditionCapability { @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; - /** - * The status of the elastic pool edition. Possible values include: - * 'Visible', 'Available', 'Default', 'Disabled'. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityStatus status; - /** * The list of supported elastic pool DTU levels for the edition. */ - @JsonProperty(value = "supportedElasticPoolDtus", access = JsonProperty.Access.WRITE_ONLY) - private List supportedElasticPoolDtus; + @JsonProperty(value = "supportedElasticPoolPerformanceLevels", access = JsonProperty.Access.WRITE_ONLY) + private List supportedElasticPoolPerformanceLevels; /** * Whether or not zone redundancy is supported for the edition. @@ -40,6 +33,19 @@ public class ElasticPoolEditionCapability { @JsonProperty(value = "zoneRedundant", access = JsonProperty.Access.WRITE_ONLY) private Boolean zoneRedundant; + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + /** * Get the name value. * @@ -49,6 +55,24 @@ public String name() { return this.name; } + /** + * Get the supportedElasticPoolPerformanceLevels value. + * + * @return the supportedElasticPoolPerformanceLevels value + */ + public List supportedElasticPoolPerformanceLevels() { + return this.supportedElasticPoolPerformanceLevels; + } + + /** + * Get the zoneRedundant value. + * + * @return the zoneRedundant value + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + /** * Get the status value. * @@ -59,21 +83,23 @@ public CapabilityStatus status() { } /** - * Get the supportedElasticPoolDtus value. + * Get the reason value. * - * @return the supportedElasticPoolDtus value + * @return the reason value */ - public List supportedElasticPoolDtus() { - return this.supportedElasticPoolDtus; + public String reason() { + return this.reason; } /** - * Get the zoneRedundant value. + * Set the reason value. * - * @return the zoneRedundant value + * @param reason the reason value to set + * @return the ElasticPoolEditionCapability object itself. */ - public Boolean zoneRedundant() { - return this.zoneRedundant; + public ElasticPoolEditionCapability withReason(String reason) { + this.reason = reason; + return this; } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolLicenseType.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolLicenseType.java new file mode 100644 index 00000000000..0694e11a689 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolLicenseType.java @@ -0,0 +1,41 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ElasticPoolLicenseType. + */ +public final class ElasticPoolLicenseType extends ExpandableStringEnum { + /** Static value LicenseIncluded for ElasticPoolLicenseType. */ + public static final ElasticPoolLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); + + /** Static value BasePrice for ElasticPoolLicenseType. */ + public static final ElasticPoolLicenseType BASE_PRICE = fromString("BasePrice"); + + /** + * Creates or finds a ElasticPoolLicenseType from its string representation. + * @param name a name to look for + * @return the corresponding ElasticPoolLicenseType + */ + @JsonCreator + public static ElasticPoolLicenseType fromString(String name) { + return fromString(name, ElasticPoolLicenseType.class); + } + + /** + * @return known ElasticPoolLicenseType values + */ + public static Collection values() { + return values(ElasticPoolLicenseType.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMaxPerformanceLevelCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMaxPerformanceLevelCapability.java new file mode 100644 index 00000000000..660c3b104a9 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMaxPerformanceLevelCapability.java @@ -0,0 +1,106 @@ +/** + * 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.sql; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The max per-database performance level capability. + */ +public class ElasticPoolPerDatabaseMaxPerformanceLevelCapability { + /** + * The maximum performance level per database. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * Unit type used to measure performance level. Possible values include: + * 'DTU', 'VCores'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private PerformanceLevelUnit unit; + + /** + * The list of supported min database performance levels. + */ + @JsonProperty(value = "supportedPerDatabaseMinPerformanceLevels", access = JsonProperty.Access.WRITE_ONLY) + private List supportedPerDatabaseMinPerformanceLevels; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the limit value. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the unit value. + * + * @return the unit value + */ + public PerformanceLevelUnit unit() { + return this.unit; + } + + /** + * Get the supportedPerDatabaseMinPerformanceLevels value. + * + * @return the supportedPerDatabaseMinPerformanceLevels value + */ + public List supportedPerDatabaseMinPerformanceLevels() { + return this.supportedPerDatabaseMinPerformanceLevels; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ElasticPoolPerDatabaseMaxPerformanceLevelCapability object itself. + */ + public ElasticPoolPerDatabaseMaxPerformanceLevelCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMinPerformanceLevelCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMinPerformanceLevelCapability.java new file mode 100644 index 00000000000..d7bfc5dac21 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseMinPerformanceLevelCapability.java @@ -0,0 +1,90 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The minimum per-database performance level capability. + */ +public class ElasticPoolPerDatabaseMinPerformanceLevelCapability { + /** + * The minimum performance level per database. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /** + * Unit type used to measure performance level. Possible values include: + * 'DTU', 'VCores'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private PerformanceLevelUnit unit; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the limit value. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Get the unit value. + * + * @return the unit value + */ + public PerformanceLevelUnit unit() { + return this.unit; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ElasticPoolPerDatabaseMinPerformanceLevelCapability object itself. + */ + public ElasticPoolPerDatabaseMinPerformanceLevelCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseSettings.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseSettings.java new file mode 100644 index 00000000000..695f403386b --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerDatabaseSettings.java @@ -0,0 +1,69 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Per database settings of an elastic pool. + */ +public class ElasticPoolPerDatabaseSettings { + /** + * The minimum capacity all databases are guaranteed. + */ + @JsonProperty(value = "minCapacity") + private Double minCapacity; + + /** + * The maximum capacity any one database can consume. + */ + @JsonProperty(value = "maxCapacity") + private Double maxCapacity; + + /** + * Get the minCapacity value. + * + * @return the minCapacity value + */ + public Double minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity value. + * + * @param minCapacity the minCapacity value to set + * @return the ElasticPoolPerDatabaseSettings object itself. + */ + public ElasticPoolPerDatabaseSettings withMinCapacity(Double minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the maxCapacity value. + * + * @return the maxCapacity value + */ + public Double maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity value. + * + * @param maxCapacity the maxCapacity value to set + * @return the ElasticPoolPerDatabaseSettings object itself. + */ + public ElasticPoolPerDatabaseSettings withMaxCapacity(Double maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerformanceLevelCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerformanceLevelCapability.java new file mode 100644 index 00000000000..7850d25330e --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolPerformanceLevelCapability.java @@ -0,0 +1,180 @@ +/** + * 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.sql; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Elastic Pool performance level capability. + */ +public class ElasticPoolPerformanceLevelCapability { + /** + * The performance level for the pool. + */ + @JsonProperty(value = "performanceLevel", access = JsonProperty.Access.WRITE_ONLY) + private PerformanceLevelCapability performanceLevel; + + /** + * The sku. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /** + * List of supported license types. + */ + @JsonProperty(value = "supportedLicenseTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedLicenseTypes; + + /** + * The maximum number of databases supported. + */ + @JsonProperty(value = "maxDatabaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxDatabaseCount; + + /** + * The included (free) max size for this performance level. + */ + @JsonProperty(value = "includedMaxSize", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability includedMaxSize; + + /** + * The list of supported max sizes. + */ + @JsonProperty(value = "supportedMaxSizes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedMaxSizes; + + /** + * The list of supported per database max sizes. + */ + @JsonProperty(value = "supportedPerDatabaseMaxSizes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedPerDatabaseMaxSizes; + + /** + * The list of supported per database max performance levels. + */ + @JsonProperty(value = "supportedPerDatabaseMaxPerformanceLevels", access = JsonProperty.Access.WRITE_ONLY) + private List supportedPerDatabaseMaxPerformanceLevels; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the performanceLevel value. + * + * @return the performanceLevel value + */ + public PerformanceLevelCapability performanceLevel() { + return this.performanceLevel; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the supportedLicenseTypes value. + * + * @return the supportedLicenseTypes value + */ + public List supportedLicenseTypes() { + return this.supportedLicenseTypes; + } + + /** + * Get the maxDatabaseCount value. + * + * @return the maxDatabaseCount value + */ + public Integer maxDatabaseCount() { + return this.maxDatabaseCount; + } + + /** + * Get the includedMaxSize value. + * + * @return the includedMaxSize value + */ + public MaxSizeCapability includedMaxSize() { + return this.includedMaxSize; + } + + /** + * Get the supportedMaxSizes value. + * + * @return the supportedMaxSizes value + */ + public List supportedMaxSizes() { + return this.supportedMaxSizes; + } + + /** + * Get the supportedPerDatabaseMaxSizes value. + * + * @return the supportedPerDatabaseMaxSizes value + */ + public List supportedPerDatabaseMaxSizes() { + return this.supportedPerDatabaseMaxSizes; + } + + /** + * Get the supportedPerDatabaseMaxPerformanceLevels value. + * + * @return the supportedPerDatabaseMaxPerformanceLevels value + */ + public List supportedPerDatabaseMaxPerformanceLevels() { + return this.supportedPerDatabaseMaxPerformanceLevels; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ElasticPoolPerformanceLevelCapability object itself. + */ + public ElasticPoolPerformanceLevelCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LicenseTypeCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LicenseTypeCapability.java new file mode 100644 index 00000000000..666d77875e0 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LicenseTypeCapability.java @@ -0,0 +1,74 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The license type capability. + */ +public class LicenseTypeCapability { + /** + * License type identifier. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the LicenseTypeCapability object itself. + */ + public LicenseTypeCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeCapability.java new file mode 100644 index 00000000000..9dc2c0290bb --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeCapability.java @@ -0,0 +1,48 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The log size capability. + */ +public class LogSizeCapability { + /** + * The log size limit (see 'unit' for the units). + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The units that the limit is expressed in. Possible values include: + * 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private LogSizeUnit unit; + + /** + * Get the limit value. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the unit value. + * + * @return the unit value + */ + public LogSizeUnit unit() { + return this.unit; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeUnit.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeUnit.java new file mode 100644 index 00000000000..16e0e35b9cd --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/LogSizeUnit.java @@ -0,0 +1,50 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LogSizeUnit. + */ +public final class LogSizeUnit extends ExpandableStringEnum { + /** Static value Megabytes for LogSizeUnit. */ + public static final LogSizeUnit MEGABYTES = fromString("Megabytes"); + + /** Static value Gigabytes for LogSizeUnit. */ + public static final LogSizeUnit GIGABYTES = fromString("Gigabytes"); + + /** Static value Terabytes for LogSizeUnit. */ + public static final LogSizeUnit TERABYTES = fromString("Terabytes"); + + /** Static value Petabytes for LogSizeUnit. */ + public static final LogSizeUnit PETABYTES = fromString("Petabytes"); + + /** Static value Percent for LogSizeUnit. */ + public static final LogSizeUnit PERCENT = fromString("Percent"); + + /** + * Creates or finds a LogSizeUnit from its string representation. + * @param name a name to look for + * @return the corresponding LogSizeUnit + */ + @JsonCreator + public static LogSizeUnit fromString(String name) { + return fromString(name, LogSizeUnit.class); + } + + /** + * @return known LogSizeUnit values + */ + public static Collection values() { + return values(LogSizeUnit.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceEditionCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceEditionCapability.java new file mode 100644 index 00000000000..71bf4b07c01 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceEditionCapability.java @@ -0,0 +1,90 @@ +/** + * 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.sql; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed server capability. + */ +public class ManagedInstanceEditionCapability { + /** + * The managed server version name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The supported families. + */ + @JsonProperty(value = "supportedFamilies", access = JsonProperty.Access.WRITE_ONLY) + private List supportedFamilies; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the supportedFamilies value. + * + * @return the supportedFamilies value + */ + public List supportedFamilies() { + return this.supportedFamilies; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ManagedInstanceEditionCapability object itself. + */ + public ManagedInstanceEditionCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceFamilyCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceFamilyCapability.java new file mode 100644 index 00000000000..d8033b65807 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceFamilyCapability.java @@ -0,0 +1,150 @@ +/** + * 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.sql; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed server family capability. + */ +public class ManagedInstanceFamilyCapability { + /** + * Family name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * SKU name. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private String sku; + + /** + * List of supported license types. + */ + @JsonProperty(value = "supportedLicenseTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedLicenseTypes; + + /** + * List of supported virtual cores values. + */ + @JsonProperty(value = "supportedVcoresValues", access = JsonProperty.Access.WRITE_ONLY) + private List supportedVcoresValues; + + /** + * Included size. + */ + @JsonProperty(value = "includedMaxSize", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability includedMaxSize; + + /** + * Storage size ranges. + */ + @JsonProperty(value = "supportedStorageSizes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageSizes; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Get the supportedLicenseTypes value. + * + * @return the supportedLicenseTypes value + */ + public List supportedLicenseTypes() { + return this.supportedLicenseTypes; + } + + /** + * Get the supportedVcoresValues value. + * + * @return the supportedVcoresValues value + */ + public List supportedVcoresValues() { + return this.supportedVcoresValues; + } + + /** + * Get the includedMaxSize value. + * + * @return the includedMaxSize value + */ + public MaxSizeCapability includedMaxSize() { + return this.includedMaxSize; + } + + /** + * Get the supportedStorageSizes value. + * + * @return the supportedStorageSizes value + */ + public List supportedStorageSizes() { + return this.supportedStorageSizes; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ManagedInstanceFamilyCapability object itself. + */ + public ManagedInstanceFamilyCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVcoresCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVcoresCapability.java new file mode 100644 index 00000000000..6c7770e297e --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVcoresCapability.java @@ -0,0 +1,89 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed instance virtual cores capability. + */ +public class ManagedInstanceVcoresCapability { + /** + * The virtual cores identifier. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The virtual cores value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Integer value; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the value value. + * + * @return the value value + */ + public Integer value() { + return this.value; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ManagedInstanceVcoresCapability object itself. + */ + public ManagedInstanceVcoresCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVersionCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVersionCapability.java new file mode 100644 index 00000000000..5d467c27586 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ManagedInstanceVersionCapability.java @@ -0,0 +1,90 @@ +/** + * 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.sql; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed instance capability. + */ +public class ManagedInstanceVersionCapability { + /** + * The server version name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The list of supported managed instance editions. + */ + @JsonProperty(value = "supportedEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedEditions; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the supportedEditions value. + * + * @return the supportedEditions value + */ + public List supportedEditions() { + return this.supportedEditions; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ManagedInstanceVersionCapability object itself. + */ + public ManagedInstanceVersionCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeCapability.java index b8b865ddc78..10618e4f6ff 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeCapability.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeCapability.java @@ -11,35 +11,28 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The maximum size limits for a database. + * The maximum size capability. */ public class MaxSizeCapability { /** - * The maximum size of the database (see 'unit' for the units). + * The maximum size limit (see 'unit' for the units). */ @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) - private long limit; + private Integer limit; /** * The units that the limit is expressed in. Possible values include: * 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes'. */ @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) - private MaxSizeUnits unit; - - /** - * The status of the maximum size capability. Possible values include: - * 'Visible', 'Available', 'Default', 'Disabled'. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityStatus status; + private MaxSizeUnit unit; /** * Get the limit value. * * @return the limit value */ - public long limit() { + public Integer limit() { return this.limit; } @@ -48,17 +41,8 @@ public long limit() { * * @return the unit value */ - public MaxSizeUnits unit() { + public MaxSizeUnit unit() { return this.unit; } - /** - * Get the status value. - * - * @return the status value - */ - public CapabilityStatus status() { - return this.status; - } - } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeRangeCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeRangeCapability.java new file mode 100644 index 00000000000..b67c51b1dea --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeRangeCapability.java @@ -0,0 +1,120 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The maximum size range capability. + */ +public class MaxSizeRangeCapability { + /** + * Minimum value. + */ + @JsonProperty(value = "minValue", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability minValue; + + /** + * Maximum value. + */ + @JsonProperty(value = "maxValue", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability maxValue; + + /** + * Scale/step size for discrete values between the minimum value and the + * maximum value. + */ + @JsonProperty(value = "scaleSize", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability scaleSize; + + /** + * Size of transaction log. + */ + @JsonProperty(value = "logSize", access = JsonProperty.Access.WRITE_ONLY) + private LogSizeCapability logSize; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the minValue value. + * + * @return the minValue value + */ + public MaxSizeCapability minValue() { + return this.minValue; + } + + /** + * Get the maxValue value. + * + * @return the maxValue value + */ + public MaxSizeCapability maxValue() { + return this.maxValue; + } + + /** + * Get the scaleSize value. + * + * @return the scaleSize value + */ + public MaxSizeCapability scaleSize() { + return this.scaleSize; + } + + /** + * Get the logSize value. + * + * @return the logSize value + */ + public LogSizeCapability logSize() { + return this.logSize; + } + + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the MaxSizeRangeCapability object itself. + */ + public MaxSizeRangeCapability withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeUnit.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeUnit.java new file mode 100644 index 00000000000..1263d1fcb50 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/MaxSizeUnit.java @@ -0,0 +1,47 @@ +/** + * 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.sql; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MaxSizeUnit. + */ +public final class MaxSizeUnit extends ExpandableStringEnum { + /** Static value Megabytes for MaxSizeUnit. */ + public static final MaxSizeUnit MEGABYTES = fromString("Megabytes"); + + /** Static value Gigabytes for MaxSizeUnit. */ + public static final MaxSizeUnit GIGABYTES = fromString("Gigabytes"); + + /** Static value Terabytes for MaxSizeUnit. */ + public static final MaxSizeUnit TERABYTES = fromString("Terabytes"); + + /** Static value Petabytes for MaxSizeUnit. */ + public static final MaxSizeUnit PETABYTES = fromString("Petabytes"); + + /** + * Creates or finds a MaxSizeUnit from its string representation. + * @param name a name to look for + * @return the corresponding MaxSizeUnit + */ + @JsonCreator + public static MaxSizeUnit fromString(String name) { + return fromString(name, MaxSizeUnit.class); + } + + /** + * @return known MaxSizeUnit values + */ + public static Collection values() { + return values(MaxSizeUnit.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelCapability.java new file mode 100644 index 00000000000..2e51b9abe39 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelCapability.java @@ -0,0 +1,48 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The performance level capability. + */ +public class PerformanceLevelCapability { + /** + * Performance level value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Double value; + + /** + * Unit type used to measure performance level. Possible values include: + * 'DTU', 'VCores'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private PerformanceLevelUnit unit; + + /** + * Get the value value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Get the unit value. + * + * @return the unit value + */ + public PerformanceLevelUnit unit() { + return this.unit; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelUnit.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelUnit.java index fcc7a2704ff..f1982757126 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelUnit.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/PerformanceLevelUnit.java @@ -8,43 +8,34 @@ package com.microsoft.azure.management.sql; +import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for PerformanceLevelUnit. */ -public enum PerformanceLevelUnit { - /** Enum value DTU. */ - DTU("DTU"); +public final class PerformanceLevelUnit extends ExpandableStringEnum { + /** Static value DTU for PerformanceLevelUnit. */ + public static final PerformanceLevelUnit DTU = fromString("DTU"); - /** The actual serialized value for a PerformanceLevelUnit instance. */ - private String value; - - PerformanceLevelUnit(String value) { - this.value = value; - } + /** Static value VCores for PerformanceLevelUnit. */ + public static final PerformanceLevelUnit VCORES = fromString("VCores"); /** - * Parses a serialized value to a PerformanceLevelUnit instance. - * - * @param value the serialized value to parse. - * @return the parsed PerformanceLevelUnit object, or null if unable to parse. + * Creates or finds a PerformanceLevelUnit from its string representation. + * @param name a name to look for + * @return the corresponding PerformanceLevelUnit */ @JsonCreator - public static PerformanceLevelUnit fromString(String value) { - PerformanceLevelUnit[] items = PerformanceLevelUnit.values(); - for (PerformanceLevelUnit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static PerformanceLevelUnit fromString(String name) { + return fromString(name, PerformanceLevelUnit.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * @return known PerformanceLevelUnit values + */ + public static Collection values() { + return values(PerformanceLevelUnit.class); } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SampleName.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SampleName.java index 4a43f311e95..8393ab04365 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SampleName.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/SampleName.java @@ -19,6 +19,12 @@ public final class SampleName extends ExpandableStringEnum { /** Static value AdventureWorksLT for SampleName. */ public static final SampleName ADVENTURE_WORKS_LT = fromString("AdventureWorksLT"); + /** Static value WideWorldImportersStd for SampleName. */ + public static final SampleName WIDE_WORLD_IMPORTERS_STD = fromString("WideWorldImportersStd"); + + /** Static value WideWorldImportersFull for SampleName. */ + public static final SampleName WIDE_WORLD_IMPORTERS_FULL = fromString("WideWorldImportersFull"); + /** * Creates or finds a SampleName from its string representation. * @param name a name to look for diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServerVersionCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServerVersionCapability.java index 383283771d1..286c26e196a 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServerVersionCapability.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServerVersionCapability.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The server capabilities. + * The server capability. */ public class ServerVersionCapability { /** @@ -21,13 +21,6 @@ public class ServerVersionCapability { @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; - /** - * The status of the server version. Possible values include: 'Visible', - * 'Available', 'Default', 'Disabled'. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityStatus status; - /** * The list of supported database editions. */ @@ -40,6 +33,19 @@ public class ServerVersionCapability { @JsonProperty(value = "supportedElasticPoolEditions", access = JsonProperty.Access.WRITE_ONLY) private List supportedElasticPoolEditions; + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /** + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + /** * Get the name value. * @@ -49,6 +55,24 @@ public String name() { return this.name; } + /** + * Get the supportedEditions value. + * + * @return the supportedEditions value + */ + public List supportedEditions() { + return this.supportedEditions; + } + + /** + * Get the supportedElasticPoolEditions value. + * + * @return the supportedElasticPoolEditions value + */ + public List supportedElasticPoolEditions() { + return this.supportedElasticPoolEditions; + } + /** * Get the status value. * @@ -59,21 +83,23 @@ public CapabilityStatus status() { } /** - * Get the supportedEditions value. + * Get the reason value. * - * @return the supportedEditions value + * @return the reason value */ - public List supportedEditions() { - return this.supportedEditions; + public String reason() { + return this.reason; } /** - * Get the supportedElasticPoolEditions value. + * Set the reason value. * - * @return the supportedElasticPoolEditions value + * @param reason the reason value to set + * @return the ServerVersionCapability object itself. */ - public List supportedElasticPoolEditions() { - return this.supportedElasticPoolEditions; + public ServerVersionCapability withReason(String reason) { + this.reason = reason; + return this; } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServiceObjectiveCapability.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServiceObjectiveCapability.java index 89c3f474689..05d5d4e7ea3 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServiceObjectiveCapability.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ServiceObjectiveCapability.java @@ -11,13 +11,17 @@ import java.util.UUID; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; /** * The service objectives capability. */ -@JsonFlatten public class ServiceObjectiveCapability { + /** + * The unique ID of the service objective. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private UUID id; + /** * The service objective name. */ @@ -25,95 +29,100 @@ public class ServiceObjectiveCapability { private String name; /** - * The status of the service objective. Possible values include: 'Visible', - * 'Available', 'Default', 'Disabled'. + * The list of supported maximum database sizes. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityStatus status; + @JsonProperty(value = "supportedMaxSizes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedMaxSizes; /** - * Unit type used to measure service objective performance level. Possible - * values include: 'DTU'. + * The performance level. */ - @JsonProperty(value = "performanceLevel.unit", access = JsonProperty.Access.WRITE_ONLY) - private PerformanceLevelUnit unit; + @JsonProperty(value = "performanceLevel", access = JsonProperty.Access.WRITE_ONLY) + private PerformanceLevelCapability performanceLevel; /** - * Performance level value. + * The sku. */ - @JsonProperty(value = "performanceLevel.value", access = JsonProperty.Access.WRITE_ONLY) - private Integer value; + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; /** - * The unique ID of the service objective. + * List of supported license types. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private UUID id; + @JsonProperty(value = "supportedLicenseTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedLicenseTypes; /** - * The list of supported maximum database sizes for this service objective. + * The included (free) max size. */ - @JsonProperty(value = "supportedMaxSizes", access = JsonProperty.Access.WRITE_ONLY) - private List supportedMaxSizes; + @JsonProperty(value = "includedMaxSize", access = JsonProperty.Access.WRITE_ONLY) + private MaxSizeCapability includedMaxSize; /** - * The included (free) max size for this service level objective. + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. */ - @JsonProperty(value = "includedMaxSize", access = JsonProperty.Access.WRITE_ONLY) - private MaxSizeCapability includedMaxSize; + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; /** - * Get the name value. + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get the id value. * - * @return the name value + * @return the id value */ - public String name() { - return this.name; + public UUID id() { + return this.id; } /** - * Get the status value. + * Get the name value. * - * @return the status value + * @return the name value */ - public CapabilityStatus status() { - return this.status; + public String name() { + return this.name; } /** - * Get the unit value. + * Get the supportedMaxSizes value. * - * @return the unit value + * @return the supportedMaxSizes value */ - public PerformanceLevelUnit unit() { - return this.unit; + public List supportedMaxSizes() { + return this.supportedMaxSizes; } /** - * Get the value value. + * Get the performanceLevel value. * - * @return the value value + * @return the performanceLevel value */ - public Integer value() { - return this.value; + public PerformanceLevelCapability performanceLevel() { + return this.performanceLevel; } /** - * Get the id value. + * Get the sku value. * - * @return the id value + * @return the sku value */ - public UUID id() { - return this.id; + public Sku sku() { + return this.sku; } /** - * Get the supportedMaxSizes value. + * Get the supportedLicenseTypes value. * - * @return the supportedMaxSizes value + * @return the supportedLicenseTypes value */ - public List supportedMaxSizes() { - return this.supportedMaxSizes; + public List supportedLicenseTypes() { + return this.supportedLicenseTypes; } /** @@ -125,4 +134,33 @@ public MaxSizeCapability includedMaxSize() { return this.includedMaxSize; } + /** + * Get the status value. + * + * @return the status value + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason value. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the ServiceObjectiveCapability object itself. + */ + public ServiceObjectiveCapability withReason(String reason) { + this.reason = reason; + return this; + } + } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/Sku.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/Sku.java new file mode 100644 index 00000000000..f670fa07f35 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/Sku.java @@ -0,0 +1,148 @@ +/** + * 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.sql; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An ARM Resource SKU. + */ +public class Sku { + /** + * The name of the SKU, typically, a letter + Number code, e.g. P3. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tier of the particular SKU, e.g. Basic, Premium. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Size of the particular SKU. + */ + @JsonProperty(value = "size") + private String size; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * Capacity of the particular SKU. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier value. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier value. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the size value. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size value. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family value. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the family value. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity value. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity value. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/CapabilitiesInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/CapabilitiesInner.java index a55ccd462e6..f35b4fb8881 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/CapabilitiesInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/CapabilitiesInner.java @@ -11,6 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.sql.CapabilityGroup; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -52,45 +53,45 @@ public CapabilitiesInner(Retrofit retrofit, SqlManagementClientImpl client) { */ interface CapabilitiesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.Capabilities listByLocation" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities") - Observable> listByLocation(@Path("subscriptionId") String subscriptionId, @Path("locationId") String locationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities") + Observable> listByLocation(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("include") CapabilityGroup include, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param locationId The location id whose capabilities are retrieved. + * @param locationName The location name whose capabilities are retrieved. * @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 LocationCapabilitiesInner object if successful. */ - public LocationCapabilitiesInner listByLocation(String locationId) { - return listByLocationWithServiceResponseAsync(locationId).toBlocking().single().body(); + public LocationCapabilitiesInner listByLocation(String locationName) { + return listByLocationWithServiceResponseAsync(locationName).toBlocking().single().body(); } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param locationId The location id whose capabilities are retrieved. + * @param locationName The location name whose capabilities are retrieved. * @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 listByLocationAsync(String locationId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(locationId), serviceCallback); + public ServiceFuture listByLocationAsync(String locationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(locationName), serviceCallback); } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param locationId The location id whose capabilities are retrieved. + * @param locationName The location name whose capabilities are retrieved. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LocationCapabilitiesInner object */ - public Observable listByLocationAsync(String locationId) { - return listByLocationWithServiceResponseAsync(locationId).map(new Func1, LocationCapabilitiesInner>() { + public Observable listByLocationAsync(String locationName) { + return listByLocationWithServiceResponseAsync(locationName).map(new Func1, LocationCapabilitiesInner>() { @Override public LocationCapabilitiesInner call(ServiceResponse response) { return response.body(); @@ -99,21 +100,96 @@ public LocationCapabilitiesInner call(ServiceResponse } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param locationId The location id whose capabilities are retrieved. + * @param locationName The location name whose capabilities are retrieved. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LocationCapabilitiesInner object */ - public Observable> listByLocationWithServiceResponseAsync(String locationId) { + public Observable> listByLocationWithServiceResponseAsync(String locationName) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName 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 (locationId == null) { - throw new IllegalArgumentException("Parameter locationId is required and cannot be null."); + final String apiVersion = "2017-10-01-preview"; + final CapabilityGroup include = null; + return service.listByLocation(locationName, this.client.subscriptionId(), include, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param locationName The location name whose capabilities are retrieved. + * @param include If specified, restricts the response to only include the selected item. Possible values include: 'supportedEditions', 'supportedElasticPoolEditions', 'supportedManagedInstanceVersions' + * @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 LocationCapabilitiesInner object if successful. + */ + public LocationCapabilitiesInner listByLocation(String locationName, CapabilityGroup include) { + return listByLocationWithServiceResponseAsync(locationName, include).toBlocking().single().body(); + } + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param locationName The location name whose capabilities are retrieved. + * @param include If specified, restricts the response to only include the selected item. Possible values include: 'supportedEditions', 'supportedElasticPoolEditions', 'supportedManagedInstanceVersions' + * @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 listByLocationAsync(String locationName, CapabilityGroup include, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(locationName, include), serviceCallback); + } + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param locationName The location name whose capabilities are retrieved. + * @param include If specified, restricts the response to only include the selected item. Possible values include: 'supportedEditions', 'supportedElasticPoolEditions', 'supportedManagedInstanceVersions' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocationCapabilitiesInner object + */ + public Observable listByLocationAsync(String locationName, CapabilityGroup include) { + return listByLocationWithServiceResponseAsync(locationName, include).map(new Func1, LocationCapabilitiesInner>() { + @Override + public LocationCapabilitiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param locationName The location name whose capabilities are retrieved. + * @param include If specified, restricts the response to only include the selected item. Possible values include: 'supportedEditions', 'supportedElasticPoolEditions', 'supportedManagedInstanceVersions' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocationCapabilitiesInner object + */ + public Observable> listByLocationWithServiceResponseAsync(String locationName, CapabilityGroup include) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName 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 = "2014-04-01"; - return service.listByLocation(this.client.subscriptionId(), locationId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01-preview"; + return service.listByLocation(locationName, this.client.subscriptionId(), include, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseInner.java index edc075948d7..ab6d6db79dd 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseInner.java @@ -8,68 +8,40 @@ package com.microsoft.azure.management.sql.implementation; -import org.joda.time.DateTime; -import java.util.UUID; +import com.microsoft.azure.management.sql.Sku; import com.microsoft.azure.management.sql.CreateMode; -import com.microsoft.azure.management.sql.DatabaseEdition; -import com.microsoft.azure.management.sql.ServiceObjectiveName; -import java.util.List; -import com.microsoft.azure.management.sql.RecommendedIndex; -import com.microsoft.azure.management.sql.ReadScale; import com.microsoft.azure.management.sql.SampleName; +import com.microsoft.azure.management.sql.DatabaseStatus; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.CatalogCollationType; +import com.microsoft.azure.management.sql.DatabaseLicenseType; +import com.microsoft.azure.management.sql.DatabaseReadScale; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Represents a database. + * A database resource. */ @JsonFlatten public class DatabaseInner extends TrackedResourceInner { /** - * Kind of database. This is metadata used for the Azure portal - * experience. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /** - * The collation of the database. If createMode is not Default, this value - * is ignored. - */ - @JsonProperty(value = "properties.collation") - private String collation; - - /** - * The creation date of the database (ISO8601 format). - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime creationDate; - - /** - * The containment state of the database. + * The name and tier of the SKU. */ - @JsonProperty(value = "properties.containmentState", access = JsonProperty.Access.WRITE_ONLY) - private Long containmentState; + @JsonProperty(value = "sku") + private Sku sku; /** - * The current service level objective ID of the database. This is the ID - * of the service level objective that is currently active. + * Kind of database. This is metadata used for the Azure portal experience. */ - @JsonProperty(value = "properties.currentServiceObjectiveId", access = JsonProperty.Access.WRITE_ONLY) - private UUID currentServiceObjectiveId; - - /** - * The ID of the database. - */ - @JsonProperty(value = "properties.databaseId", access = JsonProperty.Access.WRITE_ONLY) - private UUID databaseId; + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; /** - * This records the earliest start date and time that restore is available - * for this database (ISO8601 format). + * Resource that manages the database. */ - @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime earliestRestoreDate; + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; /** * Specifies the mode of database creation. @@ -80,10 +52,9 @@ public class DatabaseInner extends TrackedResourceInner { * sourceDatabaseId must be specified as the resource ID of the source * database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable - * or nonreadable) secondary replica of an existing database. - * sourceDatabaseId must be specified as the resource ID of the existing - * primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time * backup of an existing database. sourceDatabaseId must be specified as @@ -106,146 +77,81 @@ public class DatabaseInner extends TrackedResourceInner { * long term retention vault. recoveryServicesRecoveryPointResourceId must * be specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse - * edition. Possible values include: 'Copy', 'Default', - * 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', - * 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup'. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported + * for DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary'. */ @JsonProperty(value = "properties.createMode") private CreateMode createMode; /** - * Conditional. If createMode is Copy, NonReadableSecondary, - * OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this - * value is required. Specifies the resource ID of the source database. If - * createMode is NonReadableSecondary or OnlineSecondary, the name of the - * source database must be the same as the new database being created. + * The collation of the database. */ - @JsonProperty(value = "properties.sourceDatabaseId") - private String sourceDatabaseId; + @JsonProperty(value = "properties.collation") + private String collation; /** - * Conditional. If createMode is Restore and sourceDatabaseId is the - * deleted database's original resource id when it existed (as opposed to - * its current restorable dropped database id), then this value is - * required. Specifies the time that the database was deleted. + * The max size of the database expressed in bytes. */ - @JsonProperty(value = "properties.sourceDatabaseDeletionDate") - private DateTime sourceDatabaseDeletionDate; + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; /** - * Conditional. If createMode is PointInTimeRestore, this value is - * required. If createMode is Restore, this value is optional. Specifies - * the point in time (ISO8601 format) of the source database that will be - * restored to create the new database. Must be greater than or equal to - * the source database's earliestRestoreDate value. + * The name of the sample schema to apply when creating this database. + * Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', + * 'WideWorldImportersFull'. */ - @JsonProperty(value = "properties.restorePointInTime") - private DateTime restorePointInTime; + @JsonProperty(value = "properties.sampleName") + private SampleName sampleName; /** - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * The resource identifier of the elastic pool containing this database. */ - @JsonProperty(value = "properties.recoveryServicesRecoveryPointResourceId") - private String recoveryServicesRecoveryPointResourceId; + @JsonProperty(value = "properties.elasticPoolId") + private String elasticPoolId; /** - * The edition of the database. The DatabaseEditions enumeration contains - * all the valid editions. If createMode is NonReadableSecondary or - * OnlineSecondary, this value is ignored. To see possible values, query - * the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions -l westus --query [].name`. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2'. + * The resource identifier of the source database associated with create + * operation of this database. */ - @JsonProperty(value = "properties.edition") - private DatabaseEdition edition; + @JsonProperty(value = "properties.sourceDatabaseId") + private String sourceDatabaseId; /** - * The max size of the database expressed in bytes. If createMode is not - * Default, this value is ignored. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". - */ - @JsonProperty(value = "properties.maxSizeBytes") - private String maxSizeBytes; - - /** - * The configured service level objective ID of the database. This is the - * service level objective that is in the process of being applied to the - * database. Once successfully updated, it will match the value of - * currentServiceObjectiveId property. If requestedServiceObjectiveId and - * requestedServiceObjectiveName are both updated, the value of - * requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location <location> - * --query [].supportedServiceLevelObjectives[].name` . - */ - @JsonProperty(value = "properties.requestedServiceObjectiveId") - private UUID requestedServiceObjectiveId; - - /** - * The name of the configured service level objective of the database. This - * is the service level objective that is in the process of being applied - * to the database. Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location <location> - * --query [].supportedServiceLevelObjectives[].name`. Possible values - * include: 'System', 'System0', 'System1', 'System2', 'System3', - * 'System4', 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', - * 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', - * 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', - * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', - * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool'. - */ - @JsonProperty(value = "properties.requestedServiceObjectiveName") - private ServiceObjectiveName requestedServiceObjectiveName; - - /** - * The current service level objective of the database. Possible values - * include: 'System', 'System0', 'System1', 'System2', 'System3', - * 'System4', 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', - * 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', - * 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', - * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', - * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool'. - */ - @JsonProperty(value = "properties.serviceLevelObjective", access = JsonProperty.Access.WRITE_ONLY) - private ServiceObjectiveName serviceLevelObjective; - - /** - * The status of the database. + * The status of the database. Possible values include: 'Online', + * 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', + * 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', + * 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', + * 'Resuming', 'Scaling'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + private DatabaseStatus status; + + /** + * The ID of the database. + */ + @JsonProperty(value = "properties.databaseId", access = JsonProperty.Access.WRITE_ONLY) + private UUID databaseId; + + /** + * The creation date of the database (ISO8601 format). + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The current service level objective name of the database. + */ + @JsonProperty(value = "properties.currentServiceObjectiveName", access = JsonProperty.Access.WRITE_ONLY) + private String currentServiceObjectiveName; /** - * The name of the elastic pool the database is in. If elasticPoolName and - * requestedServiceObjectiveName are both updated, the value of - * requestedServiceObjectiveName is ignored. Not supported for - * DataWarehouse edition. + * The requested service level objective name of the database. */ - @JsonProperty(value = "properties.elasticPoolName") - private String elasticPoolName; + @JsonProperty(value = "properties.requestedServiceObjectiveName", access = JsonProperty.Access.WRITE_ONLY) + private String requestedServiceObjectiveName; /** * The default secondary region for this database. @@ -254,46 +160,58 @@ public class DatabaseInner extends TrackedResourceInner { private String defaultSecondaryLocation; /** - * The list of service tier advisors for this database. Expanded property. + * Failover Group resource identifier that this database belongs to. */ - @JsonProperty(value = "properties.serviceTierAdvisors", access = JsonProperty.Access.WRITE_ONLY) - private List serviceTierAdvisors; + @JsonProperty(value = "properties.failoverGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String failoverGroupId; /** - * The transparent data encryption info for this database. + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. */ - @JsonProperty(value = "properties.transparentDataEncryption", access = JsonProperty.Access.WRITE_ONLY) - private List transparentDataEncryption; + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; /** - * The recommended indices for this database. + * Specifies the time that the database was deleted. */ - @JsonProperty(value = "properties.recommendedIndex", access = JsonProperty.Access.WRITE_ONLY) - private List recommendedIndex; + @JsonProperty(value = "properties.sourceDatabaseDeletionDate") + private DateTime sourceDatabaseDeletionDate; /** - * The resource identifier of the failover group containing this database. + * The resource identifier of the recovery point associated with create + * operation of this database. */ - @JsonProperty(value = "properties.failoverGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String failoverGroupId; + @JsonProperty(value = "properties.recoveryServicesRecoveryPointId") + private String recoveryServicesRecoveryPointId; /** - * Conditional. If the database is a geo-secondary, readScale indicates - * whether read-only connections are allowed to this database or not. Not - * supported for DataWarehouse edition. Possible values include: 'Enabled', - * 'Disabled'. + * The resource identifier of the long term retention backup associated + * with create operation of this database. */ - @JsonProperty(value = "properties.readScale") - private ReadScale readScale; + @JsonProperty(value = "properties.longTermRetentionBackupResourceId") + private String longTermRetentionBackupResourceId; /** - * Indicates the name of the sample schema to apply when creating this - * database. If createMode is not Default, this value is ignored. Not - * supported for DataWarehouse edition. Possible values include: - * 'AdventureWorksLT'. + * The resource identifier of the recoverable database associated with + * create operation of this database. */ - @JsonProperty(value = "properties.sampleName") - private SampleName sampleName; + @JsonProperty(value = "properties.recoverableDatabaseId") + private String recoverableDatabaseId; + + /** + * The resource identifier of the restorable dropped database associated + * with create operation of this database. + */ + @JsonProperty(value = "properties.restorableDroppedDatabaseId") + private String restorableDroppedDatabaseId; + + /** + * Collation of the metadata catalog. Possible values include: + * 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS'. + */ + @JsonProperty(value = "properties.catalogCollation") + private CatalogCollationType catalogCollation; /** * Whether or not this database is zone redundant, which means the replicas @@ -303,77 +221,76 @@ public class DatabaseInner extends TrackedResourceInner { private Boolean zoneRedundant; /** - * Get the kind value. - * - * @return the kind value + * The license type to apply for this database. Possible values include: + * 'LicenseIncluded', 'BasePrice'. */ - public String kind() { - return this.kind; - } + @JsonProperty(value = "properties.licenseType") + private DatabaseLicenseType licenseType; /** - * Get the collation value. - * - * @return the collation value + * The max log size for this database. */ - public String collation() { - return this.collation; - } + @JsonProperty(value = "properties.maxLogSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long maxLogSizeBytes; /** - * Set the collation value. - * - * @param collation the collation value to set - * @return the DatabaseInner object itself. + * This records the earliest start date and time that restore is available + * for this database (ISO8601 format). */ - public DatabaseInner withCollation(String collation) { - this.collation = collation; - return this; - } + @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime earliestRestoreDate; /** - * Get the creationDate value. - * - * @return the creationDate value + * The state of read-only routing. If enabled, connections that have + * application intent set to readonly in their connection string may be + * routed to a readonly secondary replica in the same region. Possible + * values include: 'Enabled', 'Disabled'. */ - public DateTime creationDate() { - return this.creationDate; - } + @JsonProperty(value = "properties.readScale") + private DatabaseReadScale readScale; /** - * Get the containmentState value. + * The name and tier of the SKU. + */ + @JsonProperty(value = "properties.currentSku", access = JsonProperty.Access.WRITE_ONLY) + private Sku currentSku; + + /** + * Get the sku value. * - * @return the containmentState value + * @return the sku value */ - public Long containmentState() { - return this.containmentState; + public Sku sku() { + return this.sku; } /** - * Get the currentServiceObjectiveId value. + * Set the sku value. * - * @return the currentServiceObjectiveId value + * @param sku the sku value to set + * @return the DatabaseInner object itself. */ - public UUID currentServiceObjectiveId() { - return this.currentServiceObjectiveId; + public DatabaseInner withSku(Sku sku) { + this.sku = sku; + return this; } /** - * Get the databaseId value. + * Get the kind value. * - * @return the databaseId value + * @return the kind value */ - public UUID databaseId() { - return this.databaseId; + public String kind() { + return this.kind; } /** - * Get the earliestRestoreDate value. + * Get the managedBy value. * - * @return the earliestRestoreDate value + * @return the managedBy value */ - public DateTime earliestRestoreDate() { - return this.earliestRestoreDate; + public String managedBy() { + return this.managedBy; } /** @@ -397,143 +314,139 @@ public DatabaseInner withCreateMode(CreateMode createMode) { } /** - * Get the sourceDatabaseId value. + * Get the collation value. * - * @return the sourceDatabaseId value + * @return the collation value */ - public String sourceDatabaseId() { - return this.sourceDatabaseId; + public String collation() { + return this.collation; } /** - * Set the sourceDatabaseId value. + * Set the collation value. * - * @param sourceDatabaseId the sourceDatabaseId value to set + * @param collation the collation value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withSourceDatabaseId(String sourceDatabaseId) { - this.sourceDatabaseId = sourceDatabaseId; + public DatabaseInner withCollation(String collation) { + this.collation = collation; return this; } /** - * Get the sourceDatabaseDeletionDate value. + * Get the maxSizeBytes value. * - * @return the sourceDatabaseDeletionDate value + * @return the maxSizeBytes value */ - public DateTime sourceDatabaseDeletionDate() { - return this.sourceDatabaseDeletionDate; + public Long maxSizeBytes() { + return this.maxSizeBytes; } /** - * Set the sourceDatabaseDeletionDate value. + * Set the maxSizeBytes value. * - * @param sourceDatabaseDeletionDate the sourceDatabaseDeletionDate value to set + * @param maxSizeBytes the maxSizeBytes value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withSourceDatabaseDeletionDate(DateTime sourceDatabaseDeletionDate) { - this.sourceDatabaseDeletionDate = sourceDatabaseDeletionDate; + public DatabaseInner withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; return this; } /** - * Get the restorePointInTime value. + * Get the sampleName value. * - * @return the restorePointInTime value + * @return the sampleName value */ - public DateTime restorePointInTime() { - return this.restorePointInTime; + public SampleName sampleName() { + return this.sampleName; } /** - * Set the restorePointInTime value. + * Set the sampleName value. * - * @param restorePointInTime the restorePointInTime value to set + * @param sampleName the sampleName value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withRestorePointInTime(DateTime restorePointInTime) { - this.restorePointInTime = restorePointInTime; + public DatabaseInner withSampleName(SampleName sampleName) { + this.sampleName = sampleName; return this; } /** - * Get the recoveryServicesRecoveryPointResourceId value. + * Get the elasticPoolId value. * - * @return the recoveryServicesRecoveryPointResourceId value + * @return the elasticPoolId value */ - public String recoveryServicesRecoveryPointResourceId() { - return this.recoveryServicesRecoveryPointResourceId; + public String elasticPoolId() { + return this.elasticPoolId; } /** - * Set the recoveryServicesRecoveryPointResourceId value. + * Set the elasticPoolId value. * - * @param recoveryServicesRecoveryPointResourceId the recoveryServicesRecoveryPointResourceId value to set + * @param elasticPoolId the elasticPoolId value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withRecoveryServicesRecoveryPointResourceId(String recoveryServicesRecoveryPointResourceId) { - this.recoveryServicesRecoveryPointResourceId = recoveryServicesRecoveryPointResourceId; + public DatabaseInner withElasticPoolId(String elasticPoolId) { + this.elasticPoolId = elasticPoolId; return this; } /** - * Get the edition value. + * Get the sourceDatabaseId value. * - * @return the edition value + * @return the sourceDatabaseId value */ - public DatabaseEdition edition() { - return this.edition; + public String sourceDatabaseId() { + return this.sourceDatabaseId; } /** - * Set the edition value. + * Set the sourceDatabaseId value. * - * @param edition the edition value to set + * @param sourceDatabaseId the sourceDatabaseId value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withEdition(DatabaseEdition edition) { - this.edition = edition; + public DatabaseInner withSourceDatabaseId(String sourceDatabaseId) { + this.sourceDatabaseId = sourceDatabaseId; return this; } /** - * Get the maxSizeBytes value. + * Get the status value. * - * @return the maxSizeBytes value + * @return the status value */ - public String maxSizeBytes() { - return this.maxSizeBytes; + public DatabaseStatus status() { + return this.status; } /** - * Set the maxSizeBytes value. + * Get the databaseId value. * - * @param maxSizeBytes the maxSizeBytes value to set - * @return the DatabaseInner object itself. + * @return the databaseId value */ - public DatabaseInner withMaxSizeBytes(String maxSizeBytes) { - this.maxSizeBytes = maxSizeBytes; - return this; + public UUID databaseId() { + return this.databaseId; } /** - * Get the requestedServiceObjectiveId value. + * Get the creationDate value. * - * @return the requestedServiceObjectiveId value + * @return the creationDate value */ - public UUID requestedServiceObjectiveId() { - return this.requestedServiceObjectiveId; + public DateTime creationDate() { + return this.creationDate; } /** - * Set the requestedServiceObjectiveId value. + * Get the currentServiceObjectiveName value. * - * @param requestedServiceObjectiveId the requestedServiceObjectiveId value to set - * @return the DatabaseInner object itself. + * @return the currentServiceObjectiveName value */ - public DatabaseInner withRequestedServiceObjectiveId(UUID requestedServiceObjectiveId) { - this.requestedServiceObjectiveId = requestedServiceObjectiveId; - return this; + public String currentServiceObjectiveName() { + return this.currentServiceObjectiveName; } /** @@ -541,141 +454,165 @@ public DatabaseInner withRequestedServiceObjectiveId(UUID requestedServiceObject * * @return the requestedServiceObjectiveName value */ - public ServiceObjectiveName requestedServiceObjectiveName() { + public String requestedServiceObjectiveName() { return this.requestedServiceObjectiveName; } /** - * Set the requestedServiceObjectiveName value. + * Get the defaultSecondaryLocation value. * - * @param requestedServiceObjectiveName the requestedServiceObjectiveName value to set - * @return the DatabaseInner object itself. + * @return the defaultSecondaryLocation value */ - public DatabaseInner withRequestedServiceObjectiveName(ServiceObjectiveName requestedServiceObjectiveName) { - this.requestedServiceObjectiveName = requestedServiceObjectiveName; - return this; + public String defaultSecondaryLocation() { + return this.defaultSecondaryLocation; } /** - * Get the serviceLevelObjective value. + * Get the failoverGroupId value. * - * @return the serviceLevelObjective value + * @return the failoverGroupId value */ - public ServiceObjectiveName serviceLevelObjective() { - return this.serviceLevelObjective; + public String failoverGroupId() { + return this.failoverGroupId; } /** - * Get the status value. + * Get the restorePointInTime value. * - * @return the status value + * @return the restorePointInTime value */ - public String status() { - return this.status; + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set the restorePointInTime value. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; } /** - * Get the elasticPoolName value. + * Get the sourceDatabaseDeletionDate value. * - * @return the elasticPoolName value + * @return the sourceDatabaseDeletionDate value */ - public String elasticPoolName() { - return this.elasticPoolName; + public DateTime sourceDatabaseDeletionDate() { + return this.sourceDatabaseDeletionDate; } /** - * Set the elasticPoolName value. + * Set the sourceDatabaseDeletionDate value. * - * @param elasticPoolName the elasticPoolName value to set + * @param sourceDatabaseDeletionDate the sourceDatabaseDeletionDate value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withElasticPoolName(String elasticPoolName) { - this.elasticPoolName = elasticPoolName; + public DatabaseInner withSourceDatabaseDeletionDate(DateTime sourceDatabaseDeletionDate) { + this.sourceDatabaseDeletionDate = sourceDatabaseDeletionDate; return this; } /** - * Get the defaultSecondaryLocation value. + * Get the recoveryServicesRecoveryPointId value. * - * @return the defaultSecondaryLocation value + * @return the recoveryServicesRecoveryPointId value */ - public String defaultSecondaryLocation() { - return this.defaultSecondaryLocation; + public String recoveryServicesRecoveryPointId() { + return this.recoveryServicesRecoveryPointId; } /** - * Get the serviceTierAdvisors value. + * Set the recoveryServicesRecoveryPointId value. * - * @return the serviceTierAdvisors value + * @param recoveryServicesRecoveryPointId the recoveryServicesRecoveryPointId value to set + * @return the DatabaseInner object itself. */ - public List serviceTierAdvisors() { - return this.serviceTierAdvisors; + public DatabaseInner withRecoveryServicesRecoveryPointId(String recoveryServicesRecoveryPointId) { + this.recoveryServicesRecoveryPointId = recoveryServicesRecoveryPointId; + return this; } /** - * Get the transparentDataEncryption value. + * Get the longTermRetentionBackupResourceId value. * - * @return the transparentDataEncryption value + * @return the longTermRetentionBackupResourceId value */ - public List transparentDataEncryption() { - return this.transparentDataEncryption; + public String longTermRetentionBackupResourceId() { + return this.longTermRetentionBackupResourceId; } /** - * Get the recommendedIndex value. + * Set the longTermRetentionBackupResourceId value. * - * @return the recommendedIndex value + * @param longTermRetentionBackupResourceId the longTermRetentionBackupResourceId value to set + * @return the DatabaseInner object itself. */ - public List recommendedIndex() { - return this.recommendedIndex; + public DatabaseInner withLongTermRetentionBackupResourceId(String longTermRetentionBackupResourceId) { + this.longTermRetentionBackupResourceId = longTermRetentionBackupResourceId; + return this; } /** - * Get the failoverGroupId value. + * Get the recoverableDatabaseId value. * - * @return the failoverGroupId value + * @return the recoverableDatabaseId value */ - public String failoverGroupId() { - return this.failoverGroupId; + public String recoverableDatabaseId() { + return this.recoverableDatabaseId; } /** - * Get the readScale value. + * Set the recoverableDatabaseId value. * - * @return the readScale value + * @param recoverableDatabaseId the recoverableDatabaseId value to set + * @return the DatabaseInner object itself. */ - public ReadScale readScale() { - return this.readScale; + public DatabaseInner withRecoverableDatabaseId(String recoverableDatabaseId) { + this.recoverableDatabaseId = recoverableDatabaseId; + return this; } /** - * Set the readScale value. + * Get the restorableDroppedDatabaseId value. * - * @param readScale the readScale value to set + * @return the restorableDroppedDatabaseId value + */ + public String restorableDroppedDatabaseId() { + return this.restorableDroppedDatabaseId; + } + + /** + * Set the restorableDroppedDatabaseId value. + * + * @param restorableDroppedDatabaseId the restorableDroppedDatabaseId value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withReadScale(ReadScale readScale) { - this.readScale = readScale; + public DatabaseInner withRestorableDroppedDatabaseId(String restorableDroppedDatabaseId) { + this.restorableDroppedDatabaseId = restorableDroppedDatabaseId; return this; } /** - * Get the sampleName value. + * Get the catalogCollation value. * - * @return the sampleName value + * @return the catalogCollation value */ - public SampleName sampleName() { - return this.sampleName; + public CatalogCollationType catalogCollation() { + return this.catalogCollation; } /** - * Set the sampleName value. + * Set the catalogCollation value. * - * @param sampleName the sampleName value to set + * @param catalogCollation the catalogCollation value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withSampleName(SampleName sampleName) { - this.sampleName = sampleName; + public DatabaseInner withCatalogCollation(CatalogCollationType catalogCollation) { + this.catalogCollation = catalogCollation; return this; } @@ -699,4 +636,71 @@ public DatabaseInner withZoneRedundant(Boolean zoneRedundant) { return this; } + /** + * Get the licenseType value. + * + * @return the licenseType value + */ + public DatabaseLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType value. + * + * @param licenseType the licenseType value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withLicenseType(DatabaseLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the maxLogSizeBytes value. + * + * @return the maxLogSizeBytes value + */ + public Long maxLogSizeBytes() { + return this.maxLogSizeBytes; + } + + /** + * Get the earliestRestoreDate value. + * + * @return the earliestRestoreDate value + */ + public DateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Get the readScale value. + * + * @return the readScale value + */ + public DatabaseReadScale readScale() { + return this.readScale; + } + + /** + * Set the readScale value. + * + * @param readScale the readScale value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withReadScale(DatabaseReadScale readScale) { + this.readScale = readScale; + return this; + } + + /** + * Get the currentSku value. + * + * @return the currentSku value + */ + public Sku currentSku() { + return this.currentSku; + } + } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseUpdateInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseUpdateInner.java index 37603d82f0d..c9255f691bf 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseUpdateInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseUpdateInner.java @@ -8,69 +8,29 @@ package com.microsoft.azure.management.sql.implementation; -import java.util.Map; -import org.joda.time.DateTime; -import java.util.UUID; +import com.microsoft.azure.management.sql.Sku; import com.microsoft.azure.management.sql.CreateMode; -import com.microsoft.azure.management.sql.DatabaseEdition; -import com.microsoft.azure.management.sql.ServiceObjectiveName; -import java.util.List; -import com.microsoft.azure.management.sql.RecommendedIndex; -import com.microsoft.azure.management.sql.ReadScale; import com.microsoft.azure.management.sql.SampleName; +import com.microsoft.azure.management.sql.DatabaseStatus; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.CatalogCollationType; +import com.microsoft.azure.management.sql.DatabaseLicenseType; +import com.microsoft.azure.management.sql.DatabaseReadScale; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.Resource; /** - * Represents a database update. + * A database resource. */ @JsonFlatten -public class DatabaseUpdateInner extends Resource { - /** - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * The collation of the database. If createMode is not Default, this value - * is ignored. - */ - @JsonProperty(value = "properties.collation") - private String collation; - - /** - * The creation date of the database (ISO8601 format). - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime creationDate; - - /** - * The containment state of the database. - */ - @JsonProperty(value = "properties.containmentState", access = JsonProperty.Access.WRITE_ONLY) - private Long containmentState; - - /** - * The current service level objective ID of the database. This is the ID - * of the service level objective that is currently active. - */ - @JsonProperty(value = "properties.currentServiceObjectiveId", access = JsonProperty.Access.WRITE_ONLY) - private UUID currentServiceObjectiveId; - - /** - * The ID of the database. - */ - @JsonProperty(value = "properties.databaseId", access = JsonProperty.Access.WRITE_ONLY) - private UUID databaseId; - +public class DatabaseUpdateInner { /** - * This records the earliest start date and time that restore is available - * for this database (ISO8601 format). + * The name and tier of the SKU. */ - @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime earliestRestoreDate; + @JsonProperty(value = "sku") + private Sku sku; /** * Specifies the mode of database creation. @@ -81,10 +41,9 @@ public class DatabaseUpdateInner extends Resource { * sourceDatabaseId must be specified as the resource ID of the source * database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable - * or nonreadable) secondary replica of an existing database. - * sourceDatabaseId must be specified as the resource ID of the existing - * primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time * backup of an existing database. sourceDatabaseId must be specified as @@ -107,146 +66,81 @@ public class DatabaseUpdateInner extends Resource { * long term retention vault. recoveryServicesRecoveryPointResourceId must * be specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse - * edition. Possible values include: 'Copy', 'Default', - * 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', - * 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup'. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported + * for DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary'. */ @JsonProperty(value = "properties.createMode") private CreateMode createMode; /** - * Conditional. If createMode is Copy, NonReadableSecondary, - * OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this - * value is required. Specifies the resource ID of the source database. If - * createMode is NonReadableSecondary or OnlineSecondary, the name of the - * source database must be the same as the new database being created. + * The collation of the database. */ - @JsonProperty(value = "properties.sourceDatabaseId") - private String sourceDatabaseId; + @JsonProperty(value = "properties.collation") + private String collation; /** - * Conditional. If createMode is Restore and sourceDatabaseId is the - * deleted database's original resource id when it existed (as opposed to - * its current restorable dropped database id), then this value is - * required. Specifies the time that the database was deleted. + * The max size of the database expressed in bytes. */ - @JsonProperty(value = "properties.sourceDatabaseDeletionDate") - private DateTime sourceDatabaseDeletionDate; + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; /** - * Conditional. If createMode is PointInTimeRestore, this value is - * required. If createMode is Restore, this value is optional. Specifies - * the point in time (ISO8601 format) of the source database that will be - * restored to create the new database. Must be greater than or equal to - * the source database's earliestRestoreDate value. + * The name of the sample schema to apply when creating this database. + * Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', + * 'WideWorldImportersFull'. */ - @JsonProperty(value = "properties.restorePointInTime") - private DateTime restorePointInTime; + @JsonProperty(value = "properties.sampleName") + private SampleName sampleName; /** - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * The resource identifier of the elastic pool containing this database. */ - @JsonProperty(value = "properties.recoveryServicesRecoveryPointResourceId") - private String recoveryServicesRecoveryPointResourceId; + @JsonProperty(value = "properties.elasticPoolId") + private String elasticPoolId; /** - * The edition of the database. The DatabaseEditions enumeration contains - * all the valid editions. If createMode is NonReadableSecondary or - * OnlineSecondary, this value is ignored. To see possible values, query - * the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions -l westus --query [].name`. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2'. + * The resource identifier of the source database associated with create + * operation of this database. */ - @JsonProperty(value = "properties.edition") - private DatabaseEdition edition; + @JsonProperty(value = "properties.sourceDatabaseId") + private String sourceDatabaseId; /** - * The max size of the database expressed in bytes. If createMode is not - * Default, this value is ignored. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". - */ - @JsonProperty(value = "properties.maxSizeBytes") - private String maxSizeBytes; - - /** - * The configured service level objective ID of the database. This is the - * service level objective that is in the process of being applied to the - * database. Once successfully updated, it will match the value of - * currentServiceObjectiveId property. If requestedServiceObjectiveId and - * requestedServiceObjectiveName are both updated, the value of - * requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location <location> - * --query [].supportedServiceLevelObjectives[].name` . - */ - @JsonProperty(value = "properties.requestedServiceObjectiveId") - private UUID requestedServiceObjectiveId; - - /** - * The name of the configured service level objective of the database. This - * is the service level objective that is in the process of being applied - * to the database. Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location <location> - * --query [].supportedServiceLevelObjectives[].name`. Possible values - * include: 'System', 'System0', 'System1', 'System2', 'System3', - * 'System4', 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', - * 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', - * 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', - * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', - * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool'. - */ - @JsonProperty(value = "properties.requestedServiceObjectiveName") - private ServiceObjectiveName requestedServiceObjectiveName; - - /** - * The current service level objective of the database. Possible values - * include: 'System', 'System0', 'System1', 'System2', 'System3', - * 'System4', 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', - * 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', - * 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', - * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', - * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool'. - */ - @JsonProperty(value = "properties.serviceLevelObjective", access = JsonProperty.Access.WRITE_ONLY) - private ServiceObjectiveName serviceLevelObjective; - - /** - * The status of the database. + * The status of the database. Possible values include: 'Online', + * 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', + * 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', + * 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', + * 'Resuming', 'Scaling'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + private DatabaseStatus status; + + /** + * The ID of the database. + */ + @JsonProperty(value = "properties.databaseId", access = JsonProperty.Access.WRITE_ONLY) + private UUID databaseId; /** - * The name of the elastic pool the database is in. If elasticPoolName and - * requestedServiceObjectiveName are both updated, the value of - * requestedServiceObjectiveName is ignored. Not supported for - * DataWarehouse edition. + * The creation date of the database (ISO8601 format). + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The current service level objective name of the database. */ - @JsonProperty(value = "properties.elasticPoolName") - private String elasticPoolName; + @JsonProperty(value = "properties.currentServiceObjectiveName", access = JsonProperty.Access.WRITE_ONLY) + private String currentServiceObjectiveName; + + /** + * The requested service level objective name of the database. + */ + @JsonProperty(value = "properties.requestedServiceObjectiveName", access = JsonProperty.Access.WRITE_ONLY) + private String requestedServiceObjectiveName; /** * The default secondary region for this database. @@ -255,46 +149,58 @@ public class DatabaseUpdateInner extends Resource { private String defaultSecondaryLocation; /** - * The list of service tier advisors for this database. Expanded property. + * Failover Group resource identifier that this database belongs to. */ - @JsonProperty(value = "properties.serviceTierAdvisors", access = JsonProperty.Access.WRITE_ONLY) - private List serviceTierAdvisors; + @JsonProperty(value = "properties.failoverGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String failoverGroupId; /** - * The transparent data encryption info for this database. + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. */ - @JsonProperty(value = "properties.transparentDataEncryption", access = JsonProperty.Access.WRITE_ONLY) - private List transparentDataEncryption; + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; /** - * The recommended indices for this database. + * Specifies the time that the database was deleted. */ - @JsonProperty(value = "properties.recommendedIndex", access = JsonProperty.Access.WRITE_ONLY) - private List recommendedIndex; + @JsonProperty(value = "properties.sourceDatabaseDeletionDate") + private DateTime sourceDatabaseDeletionDate; /** - * The resource identifier of the failover group containing this database. + * The resource identifier of the recovery point associated with create + * operation of this database. */ - @JsonProperty(value = "properties.failoverGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String failoverGroupId; + @JsonProperty(value = "properties.recoveryServicesRecoveryPointId") + private String recoveryServicesRecoveryPointId; /** - * Conditional. If the database is a geo-secondary, readScale indicates - * whether read-only connections are allowed to this database or not. Not - * supported for DataWarehouse edition. Possible values include: 'Enabled', - * 'Disabled'. + * The resource identifier of the long term retention backup associated + * with create operation of this database. */ - @JsonProperty(value = "properties.readScale") - private ReadScale readScale; + @JsonProperty(value = "properties.longTermRetentionBackupResourceId") + private String longTermRetentionBackupResourceId; /** - * Indicates the name of the sample schema to apply when creating this - * database. If createMode is not Default, this value is ignored. Not - * supported for DataWarehouse edition. Possible values include: - * 'AdventureWorksLT'. + * The resource identifier of the recoverable database associated with + * create operation of this database. */ - @JsonProperty(value = "properties.sampleName") - private SampleName sampleName; + @JsonProperty(value = "properties.recoverableDatabaseId") + private String recoverableDatabaseId; + + /** + * The resource identifier of the restorable dropped database associated + * with create operation of this database. + */ + @JsonProperty(value = "properties.restorableDroppedDatabaseId") + private String restorableDroppedDatabaseId; + + /** + * Collation of the metadata catalog. Possible values include: + * 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS'. + */ + @JsonProperty(value = "properties.catalogCollation") + private CatalogCollationType catalogCollation; /** * Whether or not this database is zone redundant, which means the replicas @@ -304,22 +210,83 @@ public class DatabaseUpdateInner extends Resource { private Boolean zoneRedundant; /** - * Get the tags value. + * The license type to apply for this database. Possible values include: + * 'LicenseIncluded', 'BasePrice'. + */ + @JsonProperty(value = "properties.licenseType") + private DatabaseLicenseType licenseType; + + /** + * The max log size for this database. + */ + @JsonProperty(value = "properties.maxLogSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long maxLogSizeBytes; + + /** + * This records the earliest start date and time that restore is available + * for this database (ISO8601 format). + */ + @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime earliestRestoreDate; + + /** + * The state of read-only routing. If enabled, connections that have + * application intent set to readonly in their connection string may be + * routed to a readonly secondary replica in the same region. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.readScale") + private DatabaseReadScale readScale; + + /** + * The name and tier of the SKU. + */ + @JsonProperty(value = "properties.currentSku", access = JsonProperty.Access.WRITE_ONLY) + private Sku currentSku; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the sku value. * - * @return the tags value + * @return the sku value */ - public Map tags() { - return this.tags; + public Sku sku() { + return this.sku; } /** - * Set the tags value. + * Set the sku value. * - * @param tags the tags value to set + * @param sku the sku value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withTags(Map tags) { - this.tags = tags; + public DatabaseUpdateInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the createMode value. + * + * @return the createMode value + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode value. + * + * @param createMode the createMode value to set + * @return the DatabaseUpdateInner object itself. + */ + public DatabaseUpdateInner withCreateMode(CreateMode createMode) { + this.createMode = createMode; return this; } @@ -344,67 +311,62 @@ public DatabaseUpdateInner withCollation(String collation) { } /** - * Get the creationDate value. - * - * @return the creationDate value - */ - public DateTime creationDate() { - return this.creationDate; - } - - /** - * Get the containmentState value. + * Get the maxSizeBytes value. * - * @return the containmentState value + * @return the maxSizeBytes value */ - public Long containmentState() { - return this.containmentState; + public Long maxSizeBytes() { + return this.maxSizeBytes; } /** - * Get the currentServiceObjectiveId value. + * Set the maxSizeBytes value. * - * @return the currentServiceObjectiveId value + * @param maxSizeBytes the maxSizeBytes value to set + * @return the DatabaseUpdateInner object itself. */ - public UUID currentServiceObjectiveId() { - return this.currentServiceObjectiveId; + public DatabaseUpdateInner withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; + return this; } /** - * Get the databaseId value. + * Get the sampleName value. * - * @return the databaseId value + * @return the sampleName value */ - public UUID databaseId() { - return this.databaseId; + public SampleName sampleName() { + return this.sampleName; } /** - * Get the earliestRestoreDate value. + * Set the sampleName value. * - * @return the earliestRestoreDate value + * @param sampleName the sampleName value to set + * @return the DatabaseUpdateInner object itself. */ - public DateTime earliestRestoreDate() { - return this.earliestRestoreDate; + public DatabaseUpdateInner withSampleName(SampleName sampleName) { + this.sampleName = sampleName; + return this; } /** - * Get the createMode value. + * Get the elasticPoolId value. * - * @return the createMode value + * @return the elasticPoolId value */ - public CreateMode createMode() { - return this.createMode; + public String elasticPoolId() { + return this.elasticPoolId; } /** - * Set the createMode value. + * Set the elasticPoolId value. * - * @param createMode the createMode value to set + * @param elasticPoolId the elasticPoolId value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withCreateMode(CreateMode createMode) { - this.createMode = createMode; + public DatabaseUpdateInner withElasticPoolId(String elasticPoolId) { + this.elasticPoolId = elasticPoolId; return this; } @@ -429,23 +391,66 @@ public DatabaseUpdateInner withSourceDatabaseId(String sourceDatabaseId) { } /** - * Get the sourceDatabaseDeletionDate value. + * Get the status value. * - * @return the sourceDatabaseDeletionDate value + * @return the status value */ - public DateTime sourceDatabaseDeletionDate() { - return this.sourceDatabaseDeletionDate; + public DatabaseStatus status() { + return this.status; } /** - * Set the sourceDatabaseDeletionDate value. + * Get the databaseId value. * - * @param sourceDatabaseDeletionDate the sourceDatabaseDeletionDate value to set - * @return the DatabaseUpdateInner object itself. + * @return the databaseId value */ - public DatabaseUpdateInner withSourceDatabaseDeletionDate(DateTime sourceDatabaseDeletionDate) { - this.sourceDatabaseDeletionDate = sourceDatabaseDeletionDate; - return this; + public UUID databaseId() { + return this.databaseId; + } + + /** + * Get the creationDate value. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the currentServiceObjectiveName value. + * + * @return the currentServiceObjectiveName value + */ + public String currentServiceObjectiveName() { + return this.currentServiceObjectiveName; + } + + /** + * Get the requestedServiceObjectiveName value. + * + * @return the requestedServiceObjectiveName value + */ + public String requestedServiceObjectiveName() { + return this.requestedServiceObjectiveName; + } + + /** + * Get the defaultSecondaryLocation value. + * + * @return the defaultSecondaryLocation value + */ + public String defaultSecondaryLocation() { + return this.defaultSecondaryLocation; + } + + /** + * Get the failoverGroupId value. + * + * @return the failoverGroupId value + */ + public String failoverGroupId() { + return this.failoverGroupId; } /** @@ -469,186 +474,181 @@ public DatabaseUpdateInner withRestorePointInTime(DateTime restorePointInTime) { } /** - * Get the recoveryServicesRecoveryPointResourceId value. + * Get the sourceDatabaseDeletionDate value. * - * @return the recoveryServicesRecoveryPointResourceId value + * @return the sourceDatabaseDeletionDate value */ - public String recoveryServicesRecoveryPointResourceId() { - return this.recoveryServicesRecoveryPointResourceId; + public DateTime sourceDatabaseDeletionDate() { + return this.sourceDatabaseDeletionDate; } /** - * Set the recoveryServicesRecoveryPointResourceId value. + * Set the sourceDatabaseDeletionDate value. * - * @param recoveryServicesRecoveryPointResourceId the recoveryServicesRecoveryPointResourceId value to set + * @param sourceDatabaseDeletionDate the sourceDatabaseDeletionDate value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withRecoveryServicesRecoveryPointResourceId(String recoveryServicesRecoveryPointResourceId) { - this.recoveryServicesRecoveryPointResourceId = recoveryServicesRecoveryPointResourceId; + public DatabaseUpdateInner withSourceDatabaseDeletionDate(DateTime sourceDatabaseDeletionDate) { + this.sourceDatabaseDeletionDate = sourceDatabaseDeletionDate; return this; } /** - * Get the edition value. + * Get the recoveryServicesRecoveryPointId value. * - * @return the edition value + * @return the recoveryServicesRecoveryPointId value */ - public DatabaseEdition edition() { - return this.edition; + public String recoveryServicesRecoveryPointId() { + return this.recoveryServicesRecoveryPointId; } /** - * Set the edition value. + * Set the recoveryServicesRecoveryPointId value. * - * @param edition the edition value to set + * @param recoveryServicesRecoveryPointId the recoveryServicesRecoveryPointId value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withEdition(DatabaseEdition edition) { - this.edition = edition; + public DatabaseUpdateInner withRecoveryServicesRecoveryPointId(String recoveryServicesRecoveryPointId) { + this.recoveryServicesRecoveryPointId = recoveryServicesRecoveryPointId; return this; } /** - * Get the maxSizeBytes value. + * Get the longTermRetentionBackupResourceId value. * - * @return the maxSizeBytes value + * @return the longTermRetentionBackupResourceId value */ - public String maxSizeBytes() { - return this.maxSizeBytes; + public String longTermRetentionBackupResourceId() { + return this.longTermRetentionBackupResourceId; } /** - * Set the maxSizeBytes value. + * Set the longTermRetentionBackupResourceId value. * - * @param maxSizeBytes the maxSizeBytes value to set + * @param longTermRetentionBackupResourceId the longTermRetentionBackupResourceId value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withMaxSizeBytes(String maxSizeBytes) { - this.maxSizeBytes = maxSizeBytes; + public DatabaseUpdateInner withLongTermRetentionBackupResourceId(String longTermRetentionBackupResourceId) { + this.longTermRetentionBackupResourceId = longTermRetentionBackupResourceId; return this; } /** - * Get the requestedServiceObjectiveId value. + * Get the recoverableDatabaseId value. * - * @return the requestedServiceObjectiveId value + * @return the recoverableDatabaseId value */ - public UUID requestedServiceObjectiveId() { - return this.requestedServiceObjectiveId; + public String recoverableDatabaseId() { + return this.recoverableDatabaseId; } /** - * Set the requestedServiceObjectiveId value. + * Set the recoverableDatabaseId value. * - * @param requestedServiceObjectiveId the requestedServiceObjectiveId value to set + * @param recoverableDatabaseId the recoverableDatabaseId value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withRequestedServiceObjectiveId(UUID requestedServiceObjectiveId) { - this.requestedServiceObjectiveId = requestedServiceObjectiveId; + public DatabaseUpdateInner withRecoverableDatabaseId(String recoverableDatabaseId) { + this.recoverableDatabaseId = recoverableDatabaseId; return this; } /** - * Get the requestedServiceObjectiveName value. + * Get the restorableDroppedDatabaseId value. * - * @return the requestedServiceObjectiveName value + * @return the restorableDroppedDatabaseId value */ - public ServiceObjectiveName requestedServiceObjectiveName() { - return this.requestedServiceObjectiveName; + public String restorableDroppedDatabaseId() { + return this.restorableDroppedDatabaseId; } /** - * Set the requestedServiceObjectiveName value. + * Set the restorableDroppedDatabaseId value. * - * @param requestedServiceObjectiveName the requestedServiceObjectiveName value to set + * @param restorableDroppedDatabaseId the restorableDroppedDatabaseId value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withRequestedServiceObjectiveName(ServiceObjectiveName requestedServiceObjectiveName) { - this.requestedServiceObjectiveName = requestedServiceObjectiveName; + public DatabaseUpdateInner withRestorableDroppedDatabaseId(String restorableDroppedDatabaseId) { + this.restorableDroppedDatabaseId = restorableDroppedDatabaseId; return this; } /** - * Get the serviceLevelObjective value. + * Get the catalogCollation value. * - * @return the serviceLevelObjective value + * @return the catalogCollation value */ - public ServiceObjectiveName serviceLevelObjective() { - return this.serviceLevelObjective; + public CatalogCollationType catalogCollation() { + return this.catalogCollation; } /** - * Get the status value. + * Set the catalogCollation value. * - * @return the status value + * @param catalogCollation the catalogCollation value to set + * @return the DatabaseUpdateInner object itself. */ - public String status() { - return this.status; + public DatabaseUpdateInner withCatalogCollation(CatalogCollationType catalogCollation) { + this.catalogCollation = catalogCollation; + return this; } /** - * Get the elasticPoolName value. + * Get the zoneRedundant value. * - * @return the elasticPoolName value + * @return the zoneRedundant value */ - public String elasticPoolName() { - return this.elasticPoolName; + public Boolean zoneRedundant() { + return this.zoneRedundant; } /** - * Set the elasticPoolName value. + * Set the zoneRedundant value. * - * @param elasticPoolName the elasticPoolName value to set + * @param zoneRedundant the zoneRedundant value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withElasticPoolName(String elasticPoolName) { - this.elasticPoolName = elasticPoolName; + public DatabaseUpdateInner withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; return this; } /** - * Get the defaultSecondaryLocation value. - * - * @return the defaultSecondaryLocation value - */ - public String defaultSecondaryLocation() { - return this.defaultSecondaryLocation; - } - - /** - * Get the serviceTierAdvisors value. + * Get the licenseType value. * - * @return the serviceTierAdvisors value + * @return the licenseType value */ - public List serviceTierAdvisors() { - return this.serviceTierAdvisors; + public DatabaseLicenseType licenseType() { + return this.licenseType; } /** - * Get the transparentDataEncryption value. + * Set the licenseType value. * - * @return the transparentDataEncryption value + * @param licenseType the licenseType value to set + * @return the DatabaseUpdateInner object itself. */ - public List transparentDataEncryption() { - return this.transparentDataEncryption; + public DatabaseUpdateInner withLicenseType(DatabaseLicenseType licenseType) { + this.licenseType = licenseType; + return this; } /** - * Get the recommendedIndex value. + * Get the maxLogSizeBytes value. * - * @return the recommendedIndex value + * @return the maxLogSizeBytes value */ - public List recommendedIndex() { - return this.recommendedIndex; + public Long maxLogSizeBytes() { + return this.maxLogSizeBytes; } /** - * Get the failoverGroupId value. + * Get the earliestRestoreDate value. * - * @return the failoverGroupId value + * @return the earliestRestoreDate value */ - public String failoverGroupId() { - return this.failoverGroupId; + public DateTime earliestRestoreDate() { + return this.earliestRestoreDate; } /** @@ -656,7 +656,7 @@ public String failoverGroupId() { * * @return the readScale value */ - public ReadScale readScale() { + public DatabaseReadScale readScale() { return this.readScale; } @@ -666,48 +666,37 @@ public ReadScale readScale() { * @param readScale the readScale value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withReadScale(ReadScale readScale) { + public DatabaseUpdateInner withReadScale(DatabaseReadScale readScale) { this.readScale = readScale; return this; } /** - * Get the sampleName value. - * - * @return the sampleName value - */ - public SampleName sampleName() { - return this.sampleName; - } - - /** - * Set the sampleName value. + * Get the currentSku value. * - * @param sampleName the sampleName value to set - * @return the DatabaseUpdateInner object itself. + * @return the currentSku value */ - public DatabaseUpdateInner withSampleName(SampleName sampleName) { - this.sampleName = sampleName; - return this; + public Sku currentSku() { + return this.currentSku; } /** - * Get the zoneRedundant value. + * Get the tags value. * - * @return the zoneRedundant value + * @return the tags value */ - public Boolean zoneRedundant() { - return this.zoneRedundant; + public Map tags() { + return this.tags; } /** - * Set the zoneRedundant value. + * Set the tags value. * - * @param zoneRedundant the zoneRedundant value to set + * @param tags the tags value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withZoneRedundant(Boolean zoneRedundant) { - this.zoneRedundant = zoneRedundant; + public DatabaseUpdateInner withTags(Map tags) { + this.tags = tags; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabasesInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabasesInner.java index 9d5447ea6fa..765ad82edb2 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabasesInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabasesInner.java @@ -10,8 +10,12 @@ 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.sql.ResourceMoveDefinition; +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; @@ -29,6 +33,7 @@ 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; @@ -59,66 +64,6 @@ public DatabasesInner(Retrofit retrofit, SqlManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface DatabasesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.Databases pause" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause") - Observable> pause(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases beginPause" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause") - Observable> beginPause(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases resume" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume") - Observable> resume(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases beginResume" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume") - Observable> beginResume(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseInner parameters, @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.Databases beginCreateOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseInner parameters, @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.Databases update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseUpdateInner parameters, @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.Databases beginUpdate" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseUpdateInner parameters, @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.Databases delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.Databases listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases") - Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @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.Databases getByElasticPool" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}") - Observable> getByElasticPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("databaseName") String databaseName, @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.Databases listByElasticPool" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases") - Observable> listByElasticPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.Databases getByRecommendedElasticPool" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}") - Observable> getByRecommendedElasticPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("recommendedElasticPoolName") String recommendedElasticPoolName, @Path("databaseName") String databaseName, @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.Databases listByRecommendedElasticPool" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases") - Observable> listByRecommendedElasticPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("recommendedElasticPoolName") String recommendedElasticPoolName, @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.Databases importMethod" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import") Observable> importMethod(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body ImportRequestInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -151,68 +96,137 @@ interface DatabasesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions") Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.Databases upgradeDataWarehouse" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") + Observable> upgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases beginUpgradeDataWarehouse" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") + Observable> beginUpgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases") + Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner 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.sql.Databases beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner 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.sql.Databases delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseUpdateInner 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.sql.Databases beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseUpdateInner 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.sql.Databases listByElasticPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases") + Observable> listByElasticPool(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.Databases pause" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause") + Observable> pause(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases beginPause" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause") + Observable> beginPause(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases resume" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume") + Observable> resume(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases beginResume" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume") + Observable> beginResume(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @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.Databases rename" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move") Observable> rename(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceMoveDefinition parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.Databases listByServerNext" }) + @GET + Observable> listByServerNext(@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.sql.Databases listByElasticPoolNext" }) + @GET + Observable> listByElasticPoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @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 ImportExportResponseInner object if successful. */ - public void pause(String resourceGroupName, String serverName, String databaseName) { - pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); + public ImportExportResponseInner importMethod(String resourceGroupName, String serverName, ImportRequestInner parameters) { + return importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @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 pauseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture importMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable pauseAsync(String resourceGroupName, String serverName, String databaseName) { - return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + public Observable importMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { + return importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public Void call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> pauseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + public Observable> importMethodWithServiceResponseAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -222,70 +236,72 @@ public Observable> pauseWithServiceResponseAsync(String re if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (databaseName == null) { - throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + Validator.validate(parameters); final String apiVersion = "2014-04-01"; - Observable> observable = service.pause(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.importMethod(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @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 ImportExportResponseInner object if successful. */ - public void beginPause(String resourceGroupName, String serverName, String databaseName) { - beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + public ImportExportResponseInner beginImportMethod(String resourceGroupName, String serverName, ImportRequestInner parameters) { + return beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @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 beginPauseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture beginImportMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImportExportResponseInner object */ - public Observable beginPauseAsync(String resourceGroupName, String serverName, String databaseName) { - return beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + public Observable beginImportMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { + return beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public Void call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Pauses a data warehouse. + * Imports a bacpac into a new 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 serverName The name of the server. - * @param databaseName The name of the data warehouse to pause. + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImportExportResponseInner object */ - public Observable> beginPauseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + public Observable> beginImportMethodWithServiceResponseAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -295,16 +311,17 @@ public Observable> beginPauseWithServiceResponseAsync(Stri if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (databaseName == null) { - throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } + Validator.validate(parameters); final String apiVersion = "2014-04-01"; - return service.beginPause(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginImportMethod(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginPauseDelegate(response); + ServiceResponse clientResponse = beginImportMethodDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -313,70 +330,75 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginPauseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginImportMethodDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @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 ImportExportResponseInner object if successful. */ - public void resume(String resourceGroupName, String serverName, String databaseName) { - resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); + public ImportExportResponseInner createImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { + return createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @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 resumeAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture createImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable resumeAsync(String resourceGroupName, String serverName, String databaseName) { - return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + public Observable createImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { + return createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public Void call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> resumeWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + public Observable> createImportOperationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -389,67 +411,77 @@ public Observable> resumeWithServiceResponseAsync(String r if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String extensionName = "import"; final String apiVersion = "2014-04-01"; - Observable> observable = service.resume(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.createImportOperation(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, extensionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @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 ImportExportResponseInner object if successful. */ - public void beginResume(String resourceGroupName, String serverName, String databaseName) { - beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + public ImportExportResponseInner beginCreateImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { + return beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @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 beginResumeAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture beginCreateImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImportExportResponseInner object */ - public Observable beginResumeAsync(String resourceGroupName, String serverName, String databaseName) { - return beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + public Observable beginCreateImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { + return beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public Void call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. * * @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 serverName The name of the server. - * @param databaseName The name of the data warehouse to resume. + * @param databaseName The name of the database to import into + * @param parameters The required parameters for importing a Bacpac into a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the ImportExportResponseInner object */ - public Observable> beginResumeWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + public Observable> beginCreateImportOperationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -462,13 +494,18 @@ public Observable> beginResumeWithServiceResponseAsync(Str if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String extensionName = "import"; final String apiVersion = "2014-04-01"; - return service.beginResume(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginCreateImportOperation(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, extensionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginResumeDelegate(response); + ServiceResponse clientResponse = beginCreateImportOperationDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -477,75 +514,75 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginResumeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginCreateImportOperationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @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 DatabaseInner object if successful. + * @return the ImportExportResponseInner object if successful. */ - public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + public ImportExportResponseInner export(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { + return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @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 createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + public Observable exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { + return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public DatabaseInner call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + public Observable> exportWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -563,71 +600,71 @@ public Observable> createOrUpdateWithServiceRespo } Validator.validate(parameters); final String apiVersion = "2014-04-01"; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + Observable> observable = service.export(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @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 DatabaseInner object if successful. + * @return the ImportExportResponseInner object if successful. */ - public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + public ImportExportResponseInner beginExport(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { + return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @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 beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture beginExportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the ImportExportResponseInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + public Observable beginExportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { + return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { @Override - public DatabaseInner call(ServiceResponse response) { + public ImportExportResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates a new database or updates an existing database. + * Exports a database to a bacpac. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be operated on (updated or created). - * @param parameters The required parameters for creating or updating a database. + * @param databaseName The name of the database to be exported. + * @param parameters The required parameters for exporting a database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the ImportExportResponseInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + public Observable> beginExportWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -645,12 +682,12 @@ public Observable> beginCreateOrUpdateWithService } Validator.validate(parameters); final String apiVersion = "2014-04-01"; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.beginExport(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = beginExportDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -659,76 +696,75 @@ public Observable> call(Response re }); } - private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) + private ServiceResponse beginExportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates an existing database. + * Returns database metrics. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. + * @param filter An OData filter expression that describes a subset of metrics to return. * @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 DatabaseInner object if successful. + * @return the List<MetricInner> object if successful. */ - public DatabaseInner update(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + public List listMetrics(String resourceGroupName, String serverName, String databaseName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter).toBlocking().single().body(); } /** - * Updates an existing database. + * Returns database metrics. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. + * @param filter An OData filter expression that describes a subset of metrics to return. * @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 updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture> listMetricsAsync(String resourceGroupName, String serverName, String databaseName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter), serviceCallback); } /** - * Updates an existing database. + * Returns database metrics. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. + * @param filter An OData filter expression that describes a subset of metrics to return. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<MetricInner> object */ - public Observable updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + public Observable> listMetricsAsync(String resourceGroupName, String serverName, String databaseName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter).map(new Func1>, List>() { @Override - public DatabaseInner call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Updates an existing database. + * Returns database metrics. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. + * @param filter An OData filter expression that describes a subset of metrics to return. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<MetricInner> object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String filter) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -741,76 +777,89 @@ public Observable> updateWithServiceResponseAsync if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + if (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); } - Validator.validate(parameters); final String apiVersion = "2014-04-01"; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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); } /** - * Updates an existing database. + * Returns database metric definitions. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. * @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 DatabaseInner object if successful. + * @return the List<MetricDefinitionInner> object if successful. */ - public DatabaseInner beginUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + public List listMetricDefinitions(String resourceGroupName, String serverName, String databaseName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Updates an existing database. + * Returns database metric definitions. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. * @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 beginUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Updates an existing database. + * Returns database metric definitions. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the List<MetricDefinitionInner> object */ - public Observable beginUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + public Observable> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String databaseName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1>, List>() { @Override - public DatabaseInner call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Updates an existing database. + * Returns database metric definitions. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be updated. - * @param parameters The required parameters for updating a database. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the List<MetricDefinitionInner> object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -823,17 +872,14 @@ public Observable> beginUpdateWithServiceResponse if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); final String apiVersion = "2014-04-01"; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateDelegate(response); + ServiceResponse> result = listMetricDefinitionsDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -842,53 +888,52 @@ public Observable> call(Response re }); } - private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse> listMetricDefinitionsDelegate(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); } /** - * Deletes a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be deleted. + * @param databaseName The name of the database to be upgraded. * @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 resourceGroupName, String serverName, String databaseName) { - deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + public void upgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) { + upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); } /** - * Deletes a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be deleted. + * @param databaseName The name of the database to be upgraded. * @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 deleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Deletes a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be deleted. + * @param databaseName The name of the database to be upgraded. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String serverName, String databaseName) { - return deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + public Observable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { + return upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -897,18 +942,15 @@ public Void call(ServiceResponse response) { } /** - * Deletes a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be deleted. + * @param databaseName The name of the database to be upgraded. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> upgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -918,89 +960,70 @@ public Observable> deleteWithServiceResponseAsync(String r if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.delete(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.upgradeDataWarehouse(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database to be upgraded. * @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 DatabaseInner object if successful. */ - public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { - return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + public void beginUpgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) { + beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Gets a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database to be upgraded. * @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 getAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Gets a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database to be upgraded. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { - return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { + public Observable beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { + return beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { @Override - public DatabaseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets a database. + * Upgrades a data warehouse. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database to be upgraded. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginUpgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1010,14 +1033,16 @@ public Observable> getWithServiceResponseAsync(St if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - final String expand = null; - return service.get(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + return service.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = beginUpgradeDataWarehouseDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1026,87 +1051,121 @@ public Observable> call(Response re }); } + private ServiceResponse beginUpgradeDataWarehouseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Gets a database. + * Gets a list of databases. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. * @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 DatabaseInner object if successful. + * @return the PagedList<DatabaseInner> object if successful. */ - public DatabaseInner get(String resourceGroupName, String serverName, String databaseName, String expand) { - return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, expand).toBlocking().single().body(); + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Gets a database. + * Gets a list of databases. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. * @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 getAsync(String resourceGroupName, String serverName, String databaseName, String expand, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, expand), serviceCallback); + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Gets a database. + * Gets a list of databases. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable getAsync(String resourceGroupName, String serverName, String databaseName, String expand) { - return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, expand).map(new Func1, DatabaseInner>() { - @Override - public DatabaseInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Gets a database. + * Gets a list of databases. * * @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 serverName The name of the server. - * @param databaseName The name of the database to be retrieved. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String expand) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .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(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of databases. + * + 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 serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName 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."); } - final String apiVersion = "2014-04-01"; - return service.get(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-10-01-preview"; + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1114,85 +1173,89 @@ public Observable> call(Response re }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listByServerDelegate(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); } /** - * Returns a list of databases in a server. + * Gets a 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 serverName The name of the server. + * @param databaseName The name of the database. * @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 List<DatabaseInner> object if successful. + * @return the DatabaseInner object if successful. */ - public List listByServer(String resourceGroupName, String serverName) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Returns a list of databases in a server. + * Gets a 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 serverName The name of the server. + * @param databaseName The name of the database. * @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> listByServerAsync(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Returns a list of databases in a server. + * Gets a 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 serverName The name of the server. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable to the DatabaseInner object */ - public Observable> listByServerAsync(String resourceGroupName, String serverName) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { @Override - public List call(ServiceResponse> response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a list of databases in a server. + * Gets a 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 serverName The name of the server. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable to the DatabaseInner object */ - public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - final String expand = null; - final String filter = null; - return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, expand, filter, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + 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."); + } + final String apiVersion = "2017-10-01-preview"; + return service.get(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listByServerDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1201,142 +1264,138 @@ public Observable>> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Returns a list of databases in a server. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. - * @param filter An OData filter expression that describes a subset of databases to return. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 List<DatabaseInner> object if successful. + * @return the DatabaseInner object if successful. */ - public List listByServer(String resourceGroupName, String serverName, String expand, String filter) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName, expand, filter).toBlocking().single().body(); + public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); } /** - * Returns a list of databases in a server. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. - * @param filter An OData filter expression that describes a subset of databases to return. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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> listByServerAsync(String resourceGroupName, String serverName, String expand, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName, expand, filter), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Returns a list of databases in a server. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. - * @param filter An OData filter expression that describes a subset of databases to return. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable> listByServerAsync(String resourceGroupName, String serverName, String expand, String filter) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName, expand, filter).map(new Func1>, List>() { + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override - public List call(ServiceResponse> response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a list of databases in a server. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param expand A comma separated list of child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. - * @param filter An OData filter expression that describes a subset of databases to return. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName, String expand, String filter) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, expand, filter, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByServerDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByServerDelegate(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); + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets a database inside of an elastic pool. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 DatabaseInner object if successful. */ - public DatabaseInner getByElasticPool(String resourceGroupName, String serverName, String elasticPoolName, String databaseName) { - return getByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, databaseName).toBlocking().single().body(); + public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); } /** - * Gets a database inside of an elastic pool. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 getByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, databaseName), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Gets a database inside of an elastic pool. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseInner object */ - public Observable getByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName, String databaseName) { - return getByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, databaseName).map(new Func1, DatabaseInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override public DatabaseInner call(ServiceResponse response) { return response.body(); @@ -1345,38 +1404,39 @@ public DatabaseInner call(ServiceResponse response) { } /** - * Gets a database inside of an elastic pool. + * Creates a new database or updates an existing 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DatabaseInner object */ - public Observable> getByElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, String databaseName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (elasticPoolName == null) { - throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); - } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.getByElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01-preview"; + return service.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getByElasticPoolDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1385,188 +1445,163 @@ public Observable> call(Response re }); } - private ServiceResponse getByElasticPoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns a list of databases in an elastic pool. + * Deletes the 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param databaseName The name of the database. * @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 List<DatabaseInner> object if successful. */ - public List listByElasticPool(String resourceGroupName, String serverName, String elasticPoolName) { - return listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); + public void delete(String resourceGroupName, String serverName, String databaseName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); } /** - * Returns a list of databases in an elastic pool. + * Deletes the 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param databaseName The name of the database. * @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> listByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Returns a list of databases in an elastic pool. + * Deletes the 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable> listByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName) { - return listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1>, List>() { + public Observable deleteAsync(String resourceGroupName, String serverName, String databaseName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { @Override - public List call(ServiceResponse> response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a list of databases in an elastic pool. + * Deletes the 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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable>> listByElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (elasticPoolName == null) { - throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listByElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByElasticPoolDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByElasticPoolDelegate(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); + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.delete(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets a database inside of a recommented elastic pool. + * Deletes the 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. * @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 DatabaseInner object if successful. */ - public DatabaseInner getByRecommendedElasticPool(String resourceGroupName, String serverName, String recommendedElasticPoolName, String databaseName) { - return getByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String serverName, String databaseName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Gets a database inside of a recommented elastic pool. + * Deletes the 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. * @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 getByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName), serviceCallback); + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Gets a database inside of a recommented elastic pool. + * Deletes the 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, String databaseName) { - return getByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName, databaseName).map(new Func1, DatabaseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String databaseName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { @Override - public DatabaseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets a database inside of a recommented elastic pool. + * Deletes the 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the elastic pool to be retrieved. - * @param databaseName The name of the database to be retrieved. + * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DatabaseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getByRecommendedElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, String databaseName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (recommendedElasticPoolName == null) { - throw new IllegalArgumentException("Parameter recommendedElasticPoolName is required and cannot be null."); - } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.getByRecommendedElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, recommendedElasticPoolName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + return service.beginDelete(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getByRecommendedElasticPoolDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1575,258 +1610,312 @@ public Observable> call(Response re }); } - private ServiceResponse getByRecommendedElasticPoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns a list of databases inside a recommented elastic pool. + * Updates an existing 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the recommended elastic pool to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 List<DatabaseInner> object if successful. + * @return the DatabaseInner object if successful. */ - public List listByRecommendedElasticPool(String resourceGroupName, String serverName, String recommendedElasticPoolName) { - return listByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName).toBlocking().single().body(); + public DatabaseInner update(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); } /** - * Returns a list of databases inside a recommented elastic pool. + * Updates an existing 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the recommended elastic pool to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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> listByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Returns a list of databases inside a recommented elastic pool. + * Updates an existing 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the recommended elastic pool to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable> listByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) { - return listByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName).map(new Func1>, List>() { + public Observable updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override - public List call(ServiceResponse> response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a list of databases inside a recommented elastic pool. + * Updates an existing 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 serverName The name of the server. - * @param recommendedElasticPoolName The name of the recommended elastic pool to be retrieved. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<DatabaseInner> object + * @return the observable for the request */ - public Observable>> listByRecommendedElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (recommendedElasticPoolName == null) { - throw new IllegalArgumentException("Parameter recommendedElasticPoolName is required and cannot be null."); + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listByRecommendedElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, recommendedElasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByRecommendedElasticPoolDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByRecommendedElasticPoolDelegate(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); + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.update(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Imports a bacpac into a new database. + * Updates an existing 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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 ImportExportResponseInner object if successful. + * @return the DatabaseInner object if successful. */ - public ImportExportResponseInner importMethod(String resourceGroupName, String serverName, ImportRequestInner parameters) { - return importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + public DatabaseInner beginUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); } /** - * Imports a bacpac into a new database. + * Updates an existing 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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @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 importMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); } /** - * Imports a bacpac into a new database. + * Updates an existing 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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the DatabaseInner object */ - public Observable importMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { - return importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ImportExportResponseInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { @Override - public ImportExportResponseInner call(ServiceResponse response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Imports a bacpac into a new database. + * Updates an existing 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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database. + * @param parameters The requested database resource state. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the DatabaseInner object */ - public Observable> importMethodWithServiceResponseAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdateInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName 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 (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2014-04-01"; - Observable> observable = service.importMethod(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2017-10-01-preview"; + return service.beginUpdate(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** - * Imports a bacpac into a new database. + * Gets a list of databases in an elastic pool. * * @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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param elasticPoolName The name of the elastic pool. * @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 ImportExportResponseInner object if successful. + * @return the PagedList<DatabaseInner> object if successful. */ - public ImportExportResponseInner beginImportMethod(String resourceGroupName, String serverName, ImportRequestInner parameters) { - return beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + public PagedList listByElasticPool(final String resourceGroupName, final String serverName, final String elasticPoolName) { + ServiceResponse> response = listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByElasticPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Imports a bacpac into a new database. + * Gets a list of databases in an elastic pool. * * @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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param elasticPoolName The name of the elastic pool. * @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 beginImportMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + public ServiceFuture> listByElasticPoolAsync(final String resourceGroupName, final String serverName, final String elasticPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elasticPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByElasticPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Imports a bacpac into a new database. + * Gets a list of databases in an elastic pool. * * @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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable beginImportMethodAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { - return beginImportMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ImportExportResponseInner>() { - @Override - public ImportExportResponseInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listByElasticPoolAsync(final String resourceGroupName, final String serverName, final String elasticPoolName) { + return listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Imports a bacpac into a new database. + * Gets a list of databases in an elastic pool. * * @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 serverName The name of the server. - * @param parameters The required parameters for importing a Bacpac into a database. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable> beginImportMethodWithServiceResponseAsync(String resourceGroupName, String serverName, ImportRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable>> listByElasticPoolWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String elasticPoolName) { + return listByElasticPoolSinglePageAsync(resourceGroupName, serverName, elasticPoolName) + .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(listByElasticPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of databases in an elastic pool. + * + 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 serverName The name of the server. + ServiceResponse> * @param elasticPoolName The name of the elastic pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByElasticPoolSinglePageAsync(final String resourceGroupName, final String serverName, final String elasticPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + if (elasticPoolName == null) { + throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - Validator.validate(parameters); - final String apiVersion = "2014-04-01"; - return service.beginImportMethod(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + return service.listByElasticPool(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = beginImportMethodDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByElasticPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1834,78 +1923,70 @@ public Observable> call(Response beginImportMethodDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) + private ServiceResponse> listByElasticPoolDelegate(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); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @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 ImportExportResponseInner object if successful. + * @return the DatabaseInner object if successful. */ - public ImportExportResponseInner createImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - return createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + public DatabaseInner pause(String resourceGroupName, String serverName, String databaseName) { + return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @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 createImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture pauseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - return createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { + public Observable pauseAsync(String resourceGroupName, String serverName, String databaseName) { + return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { @Override - public ImportExportResponseInner call(ServiceResponse response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createImportOperationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> pauseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1915,80 +1996,71 @@ public Observable> createImportOperat if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters 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(parameters); - final String extensionName = "import"; - final String apiVersion = "2014-04-01"; - Observable> observable = service.createImportOperation(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, extensionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.pause(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @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 ImportExportResponseInner object if successful. + * @return the DatabaseInner object if successful. */ - public ImportExportResponseInner beginCreateImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - return beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + public DatabaseInner beginPause(String resourceGroupName, String serverName, String databaseName) { + return beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @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 beginCreateImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture beginPauseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the DatabaseInner object */ - public Observable beginCreateImportOperationAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - return beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { + public Observable beginPauseAsync(String resourceGroupName, String serverName, String databaseName) { + return beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { @Override - public ImportExportResponseInner call(ServiceResponse response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Creates an import operation that imports a bacpac into an existing database. The existing database must be empty. + * Pauses a 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 serverName The name of the server. - * @param databaseName The name of the database to import into - * @param parameters The required parameters for importing a Bacpac into a database. + * @param databaseName The name of the database to be paused. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the DatabaseInner object */ - public Observable> beginCreateImportOperationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginPauseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1998,18 +2070,16 @@ public Observable> beginCreateImportO if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters 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(parameters); - final String extensionName = "import"; - final String apiVersion = "2014-04-01"; - return service.beginCreateImportOperation(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, extensionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-10-01-preview"; + return service.beginPause(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateImportOperationDelegate(response); + ServiceResponse clientResponse = beginPauseDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2018,78 +2088,71 @@ public Observable> call(Response beginCreateImportOperationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(201, new TypeToken() { }.getType()) + private ServiceResponse beginPauseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @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 ImportExportResponseInner object if successful. + * @return the DatabaseInner object if successful. */ - public ImportExportResponseInner export(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + public DatabaseInner resume(String resourceGroupName, String serverName, String databaseName) { + return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @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 exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture resumeAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable exportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { + public Observable resumeAsync(String resourceGroupName, String serverName, String databaseName) { + return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { @Override - public ImportExportResponseInner call(ServiceResponse response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> exportWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> resumeWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2099,79 +2162,71 @@ public Observable> exportWithServiceR if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters 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(parameters); - final String apiVersion = "2014-04-01"; - Observable> observable = service.export(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.resume(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @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 ImportExportResponseInner object if successful. + * @return the DatabaseInner object if successful. */ - public ImportExportResponseInner beginExport(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + public DatabaseInner beginResume(String resourceGroupName, String serverName, String databaseName) { + return beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @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 beginExportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + public ServiceFuture beginResumeAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the DatabaseInner object */ - public Observable beginExportAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, ImportExportResponseInner>() { + public Observable beginResumeAsync(String resourceGroupName, String serverName, String databaseName) { + return beginResumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { @Override - public ImportExportResponseInner call(ServiceResponse response) { + public DatabaseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Exports a database to a bacpac. + * Resumes a 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 serverName The name of the server. - * @param databaseName The name of the database to be exported. - * @param parameters The required parameters for exporting a database. + * @param databaseName The name of the database to be resumed. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ImportExportResponseInner object + * @return the observable to the DatabaseInner object */ - public Observable> beginExportWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, ExportRequestInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginResumeWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2181,17 +2236,16 @@ public Observable> beginExportWithSer if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters 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(parameters); - final String apiVersion = "2014-04-01"; - return service.beginExport(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final String apiVersion = "2017-10-01-preview"; + return service.beginResume(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginExportDelegate(response); + ServiceResponse clientResponse = beginResumeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2200,78 +2254,74 @@ public Observable> call(Response beginExportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginResumeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns database metrics. + * Renames a 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 serverName The name of the server. - * @param databaseName The name of the database. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param databaseName The name of the database to rename. + * @param id The target ID for 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 List<MetricInner> object if successful. */ - public List listMetrics(String resourceGroupName, String serverName, String databaseName, String filter) { - return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter).toBlocking().single().body(); + public void rename(String resourceGroupName, String serverName, String databaseName, String id) { + renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id).toBlocking().single().body(); } /** - * Returns database metrics. + * Renames a 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 serverName The name of the server. - * @param databaseName The name of the database. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param databaseName The name of the database to rename. + * @param id The target ID for 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> listMetricsAsync(String resourceGroupName, String serverName, String databaseName, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter), serviceCallback); + public ServiceFuture renameAsync(String resourceGroupName, String serverName, String databaseName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id), serviceCallback); } /** - * Returns database metrics. + * Renames a 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 serverName The name of the server. - * @param databaseName The name of the database. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param databaseName The name of the database to rename. + * @param id The target ID for the resource * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<MetricInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> listMetricsAsync(String resourceGroupName, String serverName, String databaseName, String filter) { - return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, databaseName, filter).map(new Func1>, List>() { + public Observable renameAsync(String resourceGroupName, String serverName, String databaseName, String id) { + return renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id).map(new Func1, Void>() { @Override - public List call(ServiceResponse> response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Returns database metrics. + * Renames a 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 serverName The name of the server. - * @param databaseName The name of the database. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param databaseName The name of the database to rename. + * @param id The target ID for the resource * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<MetricInner> object + * @return the {@link ServiceResponse} object if successful. */ - public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String filter) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> renameWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String id) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2281,17 +2331,21 @@ public Observable>> listMetricsWithServiceResp if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } - if (filter == null) { - throw new IllegalArgumentException("Parameter filter 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 = "2014-04-01"; - return service.listMetrics(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + if (id == null) { + throw new IllegalArgumentException("Parameter id is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + ResourceMoveDefinition parameters = new ResourceMoveDefinition(); + parameters.withId(id); + return service.rename(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listMetricsDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + ServiceResponse clientResponse = renameDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2300,91 +2354,110 @@ public Observable>> call(Response> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse renameDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns database metric definitions. + * Gets a list of databases. * - * @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 serverName The name of the server. - * @param databaseName The name of the 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 List<MetricDefinitionInner> object if successful. + * @return the PagedList<DatabaseInner> object if successful. */ - public List listMetricDefinitions(String resourceGroupName, String serverName, String databaseName) { - return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Returns database metric definitions. + * Gets a list of databases. * - * @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 serverName The name of the server. - * @param databaseName The name of the 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> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Returns database metric definitions. + * Gets a list of databases. * - * @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 serverName The name of the server. - * @param databaseName The name of the 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 List<MetricDefinitionInner> object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String databaseName) { - return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Returns database metric definitions. + * Gets a list of databases. * - * @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 serverName The name of the server. - * @param databaseName The name of the 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 List<MetricDefinitionInner> object + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { - 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 (serverName == null) { - throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); - } - if (databaseName == null) { - throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(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(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of databases. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listMetricDefinitionsDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2392,98 +2465,110 @@ public Observable>> call(Response> listMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByServerNextDelegate(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); } /** - * Renames a database. + * Gets a list of databases in an elastic pool. * - * @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 serverName The name of the server. - * @param databaseName The name of the database to rename. - * @param id The target ID for the resource + * @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<DatabaseInner> object if successful. */ - public void rename(String resourceGroupName, String serverName, String databaseName, String id) { - renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id).toBlocking().single().body(); + public PagedList listByElasticPoolNext(final String nextPageLink) { + ServiceResponse> response = listByElasticPoolNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByElasticPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Renames a database. + * Gets a list of databases in an elastic pool. * - * @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 serverName The name of the server. - * @param databaseName The name of the database to rename. - * @param id The target ID for the resource + * @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 renameAsync(String resourceGroupName, String serverName, String databaseName, String id, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id), serviceCallback); + public ServiceFuture> listByElasticPoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByElasticPoolNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByElasticPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Renames a database. + * Gets a list of databases in an elastic pool. * - * @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 serverName The name of the server. - * @param databaseName The name of the database to rename. - * @param id The target ID for the resource + * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable renameAsync(String resourceGroupName, String serverName, String databaseName, String id) { - return renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> listByElasticPoolNextAsync(final String nextPageLink) { + return listByElasticPoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Renames a database. + * Gets a list of databases in an elastic pool. * - * @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 serverName The name of the server. - * @param databaseName The name of the database to rename. - * @param id The target ID for the resource + * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable to the PagedList<DatabaseInner> object */ - public Observable> renameWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String id) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serverName == null) { - throw new IllegalArgumentException("Parameter serverName 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 (id == null) { - throw new IllegalArgumentException("Parameter id is required and cannot be null."); + public Observable>> listByElasticPoolNextWithServiceResponseAsync(final String nextPageLink) { + return listByElasticPoolNextSinglePageAsync(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(listByElasticPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of databases in an elastic pool. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByElasticPoolNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } - final String apiVersion = "2017-03-01-preview"; - ResourceMoveDefinition parameters = new ResourceMoveDefinition(); - parameters.withId(id); - return service.rename(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + String nextUrl = String.format("%s", nextPageLink); + return service.listByElasticPoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = renameDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listByElasticPoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -2491,9 +2576,9 @@ public Observable> call(Response response) { }); } - private ServiceResponse renameDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listByElasticPoolNextDelegate(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); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolInner.java index 63340214282..3b0b013c4f8 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolInner.java @@ -8,22 +8,31 @@ package com.microsoft.azure.management.sql.implementation; -import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.Sku; import com.microsoft.azure.management.sql.ElasticPoolState; -import com.microsoft.azure.management.sql.ElasticPoolEdition; +import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.ElasticPoolPerDatabaseSettings; +import com.microsoft.azure.management.sql.ElasticPoolLicenseType; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** - * Represents a database elastic pool. + * An elastic pool. */ @JsonFlatten public class ElasticPoolInner extends TrackedResourceInner { /** - * The creation date of the elastic pool (ISO8601 format). + * The sku property. */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime creationDate; + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Kind of elastic pool. This is metadata used for the Azure portal + * experience. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; /** * The state of the elastic pool. Possible values include: 'Creating', @@ -33,166 +42,122 @@ public class ElasticPoolInner extends TrackedResourceInner { private ElasticPoolState state; /** - * The edition of the elastic pool. Possible values include: 'Basic', - * 'Standard', 'Premium'. - */ - @JsonProperty(value = "properties.edition") - private ElasticPoolEdition edition; - - /** - * The total shared DTU for the database elastic pool. - */ - @JsonProperty(value = "properties.dtu") - private Integer dtu; - - /** - * The maximum DTU any one database can consume. + * The creation date of the elastic pool (ISO8601 format). */ - @JsonProperty(value = "properties.databaseDtuMax") - private Integer databaseDtuMax; + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; /** - * The minimum DTU all databases are guaranteed. + * The storage limit for the database elastic pool in bytes. */ - @JsonProperty(value = "properties.databaseDtuMin") - private Integer databaseDtuMin; + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; /** - * Gets storage limit for the database elastic pool in MB. + * The per database settings for the elastic pool. */ - @JsonProperty(value = "properties.storageMB") - private Integer storageMB; + @JsonProperty(value = "properties.perDatabaseSettings") + private ElasticPoolPerDatabaseSettings perDatabaseSettings; /** - * Whether or not this database elastic pool is zone redundant, which means - * the replicas of this database will be spread across multiple + * Whether or not this elastic pool is zone redundant, which means the + * replicas of this elastic pool will be spread across multiple * availability zones. */ @JsonProperty(value = "properties.zoneRedundant") private Boolean zoneRedundant; /** - * Kind of elastic pool. This is metadata used for the Azure portal - * experience. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /** - * Get the creationDate value. - * - * @return the creationDate value + * The license type to apply for this elastic pool. Possible values + * include: 'LicenseIncluded', 'BasePrice'. */ - public DateTime creationDate() { - return this.creationDate; - } + @JsonProperty(value = "properties.licenseType") + private ElasticPoolLicenseType licenseType; /** - * Get the state value. + * Get the sku value. * - * @return the state value + * @return the sku value */ - public ElasticPoolState state() { - return this.state; + public Sku sku() { + return this.sku; } /** - * Get the edition value. + * Set the sku value. * - * @return the edition value - */ - public ElasticPoolEdition edition() { - return this.edition; - } - - /** - * Set the edition value. - * - * @param edition the edition value to set + * @param sku the sku value to set * @return the ElasticPoolInner object itself. */ - public ElasticPoolInner withEdition(ElasticPoolEdition edition) { - this.edition = edition; + public ElasticPoolInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the dtu value. - * - * @return the dtu value - */ - public Integer dtu() { - return this.dtu; - } - - /** - * Set the dtu value. + * Get the kind value. * - * @param dtu the dtu value to set - * @return the ElasticPoolInner object itself. + * @return the kind value */ - public ElasticPoolInner withDtu(Integer dtu) { - this.dtu = dtu; - return this; + public String kind() { + return this.kind; } /** - * Get the databaseDtuMax value. + * Get the state value. * - * @return the databaseDtuMax value + * @return the state value */ - public Integer databaseDtuMax() { - return this.databaseDtuMax; + public ElasticPoolState state() { + return this.state; } /** - * Set the databaseDtuMax value. + * Get the creationDate value. * - * @param databaseDtuMax the databaseDtuMax value to set - * @return the ElasticPoolInner object itself. + * @return the creationDate value */ - public ElasticPoolInner withDatabaseDtuMax(Integer databaseDtuMax) { - this.databaseDtuMax = databaseDtuMax; - return this; + public DateTime creationDate() { + return this.creationDate; } /** - * Get the databaseDtuMin value. + * Get the maxSizeBytes value. * - * @return the databaseDtuMin value + * @return the maxSizeBytes value */ - public Integer databaseDtuMin() { - return this.databaseDtuMin; + public Long maxSizeBytes() { + return this.maxSizeBytes; } /** - * Set the databaseDtuMin value. + * Set the maxSizeBytes value. * - * @param databaseDtuMin the databaseDtuMin value to set + * @param maxSizeBytes the maxSizeBytes value to set * @return the ElasticPoolInner object itself. */ - public ElasticPoolInner withDatabaseDtuMin(Integer databaseDtuMin) { - this.databaseDtuMin = databaseDtuMin; + public ElasticPoolInner withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; return this; } /** - * Get the storageMB value. + * Get the perDatabaseSettings value. * - * @return the storageMB value + * @return the perDatabaseSettings value */ - public Integer storageMB() { - return this.storageMB; + public ElasticPoolPerDatabaseSettings perDatabaseSettings() { + return this.perDatabaseSettings; } /** - * Set the storageMB value. + * Set the perDatabaseSettings value. * - * @param storageMB the storageMB value to set + * @param perDatabaseSettings the perDatabaseSettings value to set * @return the ElasticPoolInner object itself. */ - public ElasticPoolInner withStorageMB(Integer storageMB) { - this.storageMB = storageMB; + public ElasticPoolInner withPerDatabaseSettings(ElasticPoolPerDatabaseSettings perDatabaseSettings) { + this.perDatabaseSettings = perDatabaseSettings; return this; } @@ -217,12 +182,23 @@ public ElasticPoolInner withZoneRedundant(Boolean zoneRedundant) { } /** - * Get the kind value. + * Get the licenseType value. * - * @return the kind value + * @return the licenseType value */ - public String kind() { - return this.kind; + public ElasticPoolLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType value. + * + * @param licenseType the licenseType value to set + * @return the ElasticPoolInner object itself. + */ + public ElasticPoolInner withLicenseType(ElasticPoolLicenseType licenseType) { + this.licenseType = licenseType; + return this; } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolUpdateInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolUpdateInner.java index 649dd59994f..7b69d7861e9 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolUpdateInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolUpdateInner.java @@ -8,232 +8,174 @@ package com.microsoft.azure.management.sql.implementation; +import com.microsoft.azure.management.sql.Sku; +import com.microsoft.azure.management.sql.ElasticPoolPerDatabaseSettings; +import com.microsoft.azure.management.sql.ElasticPoolLicenseType; import java.util.Map; -import org.joda.time.DateTime; -import com.microsoft.azure.management.sql.ElasticPoolState; -import com.microsoft.azure.management.sql.ElasticPoolEdition; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.Resource; /** - * Represents an elastic pool update. + * An elastic pool update. */ @JsonFlatten -public class ElasticPoolUpdateInner extends Resource { +public class ElasticPoolUpdateInner { /** - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * The creation date of the elastic pool (ISO8601 format). - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private DateTime creationDate; - - /** - * The state of the elastic pool. Possible values include: 'Creating', - * 'Ready', 'Disabled'. - */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private ElasticPoolState state; - - /** - * The edition of the elastic pool. Possible values include: 'Basic', - * 'Standard', 'Premium'. - */ - @JsonProperty(value = "properties.edition") - private ElasticPoolEdition edition; - - /** - * The total shared DTU for the database elastic pool. - */ - @JsonProperty(value = "properties.dtu") - private Integer dtu; - - /** - * The maximum DTU any one database can consume. + * The sku property. */ - @JsonProperty(value = "properties.databaseDtuMax") - private Integer databaseDtuMax; + @JsonProperty(value = "sku") + private Sku sku; /** - * The minimum DTU all databases are guaranteed. + * The storage limit for the database elastic pool in bytes. */ - @JsonProperty(value = "properties.databaseDtuMin") - private Integer databaseDtuMin; + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; /** - * Gets storage limit for the database elastic pool in MB. + * The per database settings for the elastic pool. */ - @JsonProperty(value = "properties.storageMB") - private Integer storageMB; + @JsonProperty(value = "properties.perDatabaseSettings") + private ElasticPoolPerDatabaseSettings perDatabaseSettings; /** - * Whether or not this database elastic pool is zone redundant, which means - * the replicas of this database will be spread across multiple + * Whether or not this elastic pool is zone redundant, which means the + * replicas of this elastic pool will be spread across multiple * availability zones. */ @JsonProperty(value = "properties.zoneRedundant") private Boolean zoneRedundant; /** - * Get the tags value. - * - * @return the tags value + * The license type to apply for this elastic pool. Possible values + * include: 'LicenseIncluded', 'BasePrice'. */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags value. - * - * @param tags the tags value to set - * @return the ElasticPoolUpdateInner object itself. - */ - public ElasticPoolUpdateInner withTags(Map tags) { - this.tags = tags; - return this; - } + @JsonProperty(value = "properties.licenseType") + private ElasticPoolLicenseType licenseType; /** - * Get the creationDate value. - * - * @return the creationDate value - */ - public DateTime creationDate() { - return this.creationDate; - } - - /** - * Get the state value. - * - * @return the state value + * Resource tags. */ - public ElasticPoolState state() { - return this.state; - } + @JsonProperty(value = "tags") + private Map tags; /** - * Get the edition value. + * Get the sku value. * - * @return the edition value + * @return the sku value */ - public ElasticPoolEdition edition() { - return this.edition; + public Sku sku() { + return this.sku; } /** - * Set the edition value. + * Set the sku value. * - * @param edition the edition value to set + * @param sku the sku value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withEdition(ElasticPoolEdition edition) { - this.edition = edition; + public ElasticPoolUpdateInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the dtu value. + * Get the maxSizeBytes value. * - * @return the dtu value + * @return the maxSizeBytes value */ - public Integer dtu() { - return this.dtu; + public Long maxSizeBytes() { + return this.maxSizeBytes; } /** - * Set the dtu value. + * Set the maxSizeBytes value. * - * @param dtu the dtu value to set + * @param maxSizeBytes the maxSizeBytes value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withDtu(Integer dtu) { - this.dtu = dtu; + public ElasticPoolUpdateInner withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; return this; } /** - * Get the databaseDtuMax value. + * Get the perDatabaseSettings value. * - * @return the databaseDtuMax value + * @return the perDatabaseSettings value */ - public Integer databaseDtuMax() { - return this.databaseDtuMax; + public ElasticPoolPerDatabaseSettings perDatabaseSettings() { + return this.perDatabaseSettings; } /** - * Set the databaseDtuMax value. + * Set the perDatabaseSettings value. * - * @param databaseDtuMax the databaseDtuMax value to set + * @param perDatabaseSettings the perDatabaseSettings value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withDatabaseDtuMax(Integer databaseDtuMax) { - this.databaseDtuMax = databaseDtuMax; + public ElasticPoolUpdateInner withPerDatabaseSettings(ElasticPoolPerDatabaseSettings perDatabaseSettings) { + this.perDatabaseSettings = perDatabaseSettings; return this; } /** - * Get the databaseDtuMin value. + * Get the zoneRedundant value. * - * @return the databaseDtuMin value + * @return the zoneRedundant value */ - public Integer databaseDtuMin() { - return this.databaseDtuMin; + public Boolean zoneRedundant() { + return this.zoneRedundant; } /** - * Set the databaseDtuMin value. + * Set the zoneRedundant value. * - * @param databaseDtuMin the databaseDtuMin value to set + * @param zoneRedundant the zoneRedundant value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withDatabaseDtuMin(Integer databaseDtuMin) { - this.databaseDtuMin = databaseDtuMin; + public ElasticPoolUpdateInner withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; return this; } /** - * Get the storageMB value. + * Get the licenseType value. * - * @return the storageMB value + * @return the licenseType value */ - public Integer storageMB() { - return this.storageMB; + public ElasticPoolLicenseType licenseType() { + return this.licenseType; } /** - * Set the storageMB value. + * Set the licenseType value. * - * @param storageMB the storageMB value to set + * @param licenseType the licenseType value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withStorageMB(Integer storageMB) { - this.storageMB = storageMB; + public ElasticPoolUpdateInner withLicenseType(ElasticPoolLicenseType licenseType) { + this.licenseType = licenseType; return this; } /** - * Get the zoneRedundant value. + * Get the tags value. * - * @return the zoneRedundant value + * @return the tags value */ - public Boolean zoneRedundant() { - return this.zoneRedundant; + public Map tags() { + return this.tags; } /** - * Set the zoneRedundant value. + * Set the tags value. * - * @param zoneRedundant the zoneRedundant value to set + * @param tags the tags value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withZoneRedundant(Boolean zoneRedundant) { - this.zoneRedundant = zoneRedundant; + public ElasticPoolUpdateInner withTags(Map tags) { + this.tags = tags; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolsInner.java index 094a5d72ce9..1c108584033 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolsInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolsInner.java @@ -10,7 +10,11 @@ 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; @@ -27,6 +31,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; @@ -57,105 +62,208 @@ public ElasticPoolsInner(Retrofit retrofit, SqlManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface ElasticPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.ElasticPools listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.ElasticPools listMetricDefinitions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions") + Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools") + Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Query("$skip") Integer skip, @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.ElasticPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Body ElasticPoolInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("subscriptionId") String subscriptionId, @Body ElasticPoolInner 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.sql.ElasticPools beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Body ElasticPoolInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("subscriptionId") String subscriptionId, @Body ElasticPoolInner 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.sql.ElasticPools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Body ElasticPoolUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("subscriptionId") String subscriptionId, @Body ElasticPoolUpdateInner 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.sql.ElasticPools beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Body ElasticPoolUpdateInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("subscriptionId") String subscriptionId, @Body ElasticPoolUpdateInner 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.sql.ElasticPools delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools listByServerNext" }) + @GET + Observable> listByServerNext(@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.sql.ElasticPools get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @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.ElasticPools listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools") - Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + /** + * Returns elastic pool metrics. + * + * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param filter An OData filter expression that describes a subset of metrics to return. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String serverName, String elasticPoolName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter).toBlocking().single().body(); + } - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.ElasticPools listMetrics" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics") - Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + /** + * Returns elastic pool metrics. + * + * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param filter An OData filter expression that describes a subset of metrics to return. + * @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> listMetricsAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter), serviceCallback); + } - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.ElasticPools listMetricDefinitions" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions") - Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + /** + * Returns elastic pool metrics. + * + * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param filter An OData filter expression that describes a subset of metrics to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + /** + * Returns elastic pool metrics. + * + * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param filter An OData filter expression that describes a subset of metrics to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter) { + 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 (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (elasticPoolName == null) { + throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); + } + if (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + final String apiVersion = "2014-04-01"; + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns elastic pool metric definitions. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @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 ElasticPoolInner object if successful. + * @return the List<MetricDefinitionInner> object if successful. */ - public ElasticPoolInner createOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().last().body(); + public List listMetricDefinitions(String resourceGroupName, String serverName, String elasticPoolName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns elastic pool metric definitions. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @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 createOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); + public ServiceFuture> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns elastic pool metric definitions. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<MetricDefinitionInner> object */ - public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { + public Observable> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String elasticPoolName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1>, List>() { @Override - public ElasticPoolInner call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns elastic pool metric definitions. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request + * @return the observable to the List<MetricDefinitionInner> object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { + public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -168,58 +276,310 @@ public Observable> createOrUpdateWithServiceRe if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); final String apiVersion = "2014-04-01"; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return service.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricDefinitionsDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricDefinitionsDelegate(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); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @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<ElasticPoolInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @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> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .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(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ElasticPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName 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 = "2017-10-01-preview"; + final Integer skip = null; + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), skip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets all elastic pools in a server. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param skip The number of elements in the collection to skip. + * @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<ElasticPoolInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final Integer skip) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @param skip The number of elements in the collection to skip. + * @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> listByServerAsync(final String resourceGroupName, final String serverName, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @param skip The number of elements in the collection to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final Integer skip) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all elastic pools in a server. + * + * @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 serverName The name of the server. + * @param skip The number of elements in the collection to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final Integer skip) { + return listByServerSinglePageAsync(resourceGroupName, serverName, skip) + .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(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all elastic pools in a server. + * + 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 serverName The name of the server. + ServiceResponse> * @param skip The number of elements in the collection to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ElasticPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final Integer skip) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName 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 = "2017-10-01-preview"; + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), skip, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(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); + } + + /** + * Gets an elastic pool. + * + * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. * @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 ElasticPoolInner object if successful. */ - public ElasticPoolInner beginCreateOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().single().body(); + public ElasticPoolInner get(String resourceGroupName, String serverName, String elasticPoolName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @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 beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ElasticPoolInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { + public Observable getAsync(String resourceGroupName, String serverName, String elasticPoolName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1, ElasticPoolInner>() { @Override public ElasticPoolInner call(ServiceResponse response) { return response.body(); @@ -228,19 +588,15 @@ public ElasticPoolInner call(ServiceResponse response) { } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be operated on (updated or created). - * @param parameters The required parameters for creating or updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ElasticPoolInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -250,17 +606,16 @@ public Observable> beginCreateOrUpdateWithServ if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters 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(parameters); - final String apiVersion = "2014-04-01"; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01-preview"; + return service.get(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -269,58 +624,56 @@ public Observable> call(Response }); } - private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @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 ElasticPoolInner object if successful. */ - public ElasticPoolInner update(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().last().body(); + public ElasticPoolInner createOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().last().body(); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @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 updateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { @Override public ElasticPoolInner call(ServiceResponse response) { return response.body(); @@ -329,19 +682,16 @@ public ElasticPoolInner call(ServiceResponse response) { } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -351,58 +701,61 @@ public Observable> updateWithServiceResponseAs if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName 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 (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2014-04-01"; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @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 ElasticPoolInner object if successful. */ - public ElasticPoolInner beginUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().single().body(); + public ElasticPoolInner beginCreateOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().single().body(); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @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 beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ElasticPoolInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { @Override public ElasticPoolInner call(ServiceResponse response) { return response.body(); @@ -411,19 +764,16 @@ public ElasticPoolInner call(ServiceResponse response) { } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be updated. - * @param parameters The required parameters for updating an elastic pool. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool parameters. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ElasticPoolInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -433,17 +783,20 @@ public Observable> beginUpdateWithServiceRespo if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName 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 (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2014-04-01"; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01-preview"; + return service.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -452,34 +805,35 @@ public Observable> call(Response }); } - private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be deleted. + * @param elasticPoolName The name of the elastic pool. * @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 resourceGroupName, String serverName, String elasticPoolName) { - deleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); + deleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().last().body(); } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be deleted. + * @param elasticPoolName The name of the elastic pool. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -489,13 +843,13 @@ public ServiceFuture deleteAsync(String resourceGroupName, String serverNa } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be deleted. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable deleteAsync(String resourceGroupName, String serverName, String elasticPoolName) { return deleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1, Void>() { @@ -507,18 +861,15 @@ public Void call(ServiceResponse response) { } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be deleted. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { - 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."); } @@ -528,89 +879,70 @@ public Observable> deleteWithServiceResponseAsync(String r if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.delete(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = deleteDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.delete(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** - * Gets an elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param elasticPoolName The name of the elastic pool. * @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 ElasticPoolInner object if successful. */ - public ElasticPoolInner get(String resourceGroupName, String serverName, String elasticPoolName) { - return getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String serverName, String elasticPoolName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); } /** - * Gets an elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param elasticPoolName The name of the elastic pool. * @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 getAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); } /** - * Gets an elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ElasticPoolInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getAsync(String resourceGroupName, String serverName, String elasticPoolName) { - return getWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1, ElasticPoolInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String elasticPoolName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1, Void>() { @Override - public ElasticPoolInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets an elastic pool. + * Deletes an elastic pool. * * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool to be retrieved. + * @param elasticPoolName The name of the elastic pool. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ElasticPoolInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -620,13 +952,16 @@ public Observable> getWithServiceResponseAsync if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.get(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-10-01-preview"; + return service.beginDelete(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -635,162 +970,158 @@ public Observable> call(Response }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns a list of elastic pools in a server. + * Updates an elastic pool. * * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool update parameters. * @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 List<ElasticPoolInner> object if successful. + * @return the ElasticPoolInner object if successful. */ - public List listByServer(String resourceGroupName, String serverName) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + public ElasticPoolInner update(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().last().body(); } /** - * Returns a list of elastic pools in a server. + * Updates an elastic pool. * * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool update parameters. * @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> listByServerAsync(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); } /** - * Returns a list of elastic pools in a server. + * Updates an elastic pool. * * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ElasticPoolInner> object + * @return the observable for the request */ - public Observable> listByServerAsync(String resourceGroupName, String serverName) { - return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + public Observable updateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { @Override - public List call(ServiceResponse> response) { + public ElasticPoolInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns a list of elastic pools in a server. + * Updates an elastic pool. * * @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 serverName The name of the server. + * @param elasticPoolName The name of the elastic pool. + * @param parameters The elastic pool update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<ElasticPoolInner> object + * @return the observable for the request */ - public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByServerDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByServerDelegate(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); + if (elasticPoolName == null) { + throw new IllegalArgumentException("Parameter elasticPoolName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01-preview"; + Observable> observable = service.update(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** - * Returns elastic pool metrics. + * Updates an elastic pool. * * @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 serverName The name of the server. * @param elasticPoolName The name of the elastic pool. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param parameters The elastic pool update parameters. * @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 List<MetricInner> object if successful. + * @return the ElasticPoolInner object if successful. */ - public List listMetrics(String resourceGroupName, String serverName, String elasticPoolName, String filter) { - return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter).toBlocking().single().body(); + public ElasticPoolInner beginUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().single().body(); } /** - * Returns elastic pool metrics. + * Updates an elastic pool. * * @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 serverName The name of the server. * @param elasticPoolName The name of the elastic pool. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param parameters The elastic pool update parameters. * @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> listMetricsAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters), serviceCallback); } /** - * Returns elastic pool metrics. + * Updates an elastic pool. * * @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 serverName The name of the server. * @param elasticPoolName The name of the elastic pool. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param parameters The elastic pool update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<MetricInner> object + * @return the observable to the ElasticPoolInner object */ - public Observable> listMetricsAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter) { - return listMetricsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, filter).map(new Func1>, List>() { + public Observable beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1, ElasticPoolInner>() { @Override - public List call(ServiceResponse> response) { + public ElasticPoolInner call(ServiceResponse response) { return response.body(); } }); } /** - * Returns elastic pool metrics. + * Updates an elastic pool. * * @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 serverName The name of the server. * @param elasticPoolName The name of the elastic pool. - * @param filter An OData filter expression that describes a subset of metrics to return. + * @param parameters The elastic pool update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<MetricInner> object + * @return the observable to the ElasticPoolInner object */ - public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, String filter) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdateInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -800,17 +1131,20 @@ public Observable>> listMetricsWithServiceResp if (elasticPoolName == null) { throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); } - if (filter == null) { - throw new IllegalArgumentException("Parameter filter 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 = "2014-04-01"; - return service.listMetrics(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01-preview"; + return service.beginUpdate(resourceGroupName, serverName, elasticPoolName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listMetricsDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + ServiceResponse clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -819,91 +1153,111 @@ public Observable>> call(Response> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Returns elastic pool metric definitions. + * Gets all elastic pools in a server. * - * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool. + * @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 List<MetricDefinitionInner> object if successful. + * @return the PagedList<ElasticPoolInner> object if successful. */ - public List listMetricDefinitions(String resourceGroupName, String serverName, String elasticPoolName) { - return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body(); + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Returns elastic pool metric definitions. + * Gets all elastic pools in a server. * - * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool. + * @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> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String elasticPoolName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName), serviceCallback); + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Returns elastic pool metric definitions. + * Gets all elastic pools in a server. * - * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool. + * @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 List<MetricDefinitionInner> object + * @return the observable to the PagedList<ElasticPoolInner> object */ - public Observable> listMetricDefinitionsAsync(String resourceGroupName, String serverName, String elasticPoolName) { - return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Returns elastic pool metric definitions. + * Gets all elastic pools in a server. * - * @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 serverName The name of the server. - * @param elasticPoolName The name of the elastic pool. + * @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 List<MetricDefinitionInner> object + * @return the observable to the PagedList<ElasticPoolInner> object */ - public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) { - 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 (serverName == null) { - throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); - } - if (elasticPoolName == null) { - throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null."); + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(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(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all elastic pools in a server. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ElasticPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } - final String apiVersion = "2014-04-01"; - return service.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listMetricDefinitionsDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -911,9 +1265,9 @@ public Observable>> call(Response> listMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByServerNextDelegate(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); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LocationCapabilitiesInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LocationCapabilitiesInner.java index be794184731..27145505693 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LocationCapabilitiesInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/LocationCapabilitiesInner.java @@ -8,13 +8,14 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.CapabilityStatus; import java.util.List; import com.microsoft.azure.management.sql.ServerVersionCapability; +import com.microsoft.azure.management.sql.ManagedInstanceVersionCapability; +import com.microsoft.azure.management.sql.CapabilityStatus; import com.fasterxml.jackson.annotation.JsonProperty; /** - * The capabilities for a location. + * The location capability. */ public class LocationCapabilitiesInner { /** @@ -24,17 +25,29 @@ public class LocationCapabilitiesInner { private String name; /** - * Azure SQL Database's status for the location. Possible values include: - * 'Visible', 'Available', 'Default', 'Disabled'. + * The list of supported server versions. + */ + @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerVersions; + + /** + * The list of supported managed instance versions. + */ + @JsonProperty(value = "supportedManagedInstanceVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedManagedInstanceVersions; + + /** + * The status of the capability. Possible values include: 'Visible', + * 'Available', 'Default', 'Disabled'. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private CapabilityStatus status; /** - * The list of supported server versions. + * The reason for the capability not being available. */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedServerVersions; + @JsonProperty(value = "reason") + private String reason; /** * Get the name value. @@ -45,6 +58,24 @@ public String name() { return this.name; } + /** + * Get the supportedServerVersions value. + * + * @return the supportedServerVersions value + */ + public List supportedServerVersions() { + return this.supportedServerVersions; + } + + /** + * Get the supportedManagedInstanceVersions value. + * + * @return the supportedManagedInstanceVersions value + */ + public List supportedManagedInstanceVersions() { + return this.supportedManagedInstanceVersions; + } + /** * Get the status value. * @@ -55,12 +86,23 @@ public CapabilityStatus status() { } /** - * Get the supportedServerVersions value. + * Get the reason value. * - * @return the supportedServerVersions value + * @return the reason value */ - public List supportedServerVersions() { - return this.supportedServerVersions; + public String reason() { + return this.reason; + } + + /** + * Set the reason value. + * + * @param reason the reason value to set + * @return the LocationCapabilitiesInner object itself. + */ + public LocationCapabilitiesInner withReason(String reason) { + this.reason = reason; + return this; } } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RecommendedElasticPoolInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RecommendedElasticPoolInner.java index a7558c8de6d..52ac21387a3 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RecommendedElasticPoolInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RecommendedElasticPoolInner.java @@ -79,7 +79,7 @@ public class RecommendedElasticPoolInner extends ProxyResourceInner { * The list of databases in this pool. Expanded property. */ @JsonProperty(value = "properties.databases", access = JsonProperty.Access.WRITE_ONLY) - private List databases; + private List databases; /** * The list of databases housed in the server. Expanded property. @@ -217,7 +217,7 @@ public Double maxObservedStorageMB() { * * @return the databases value */ - public List databases() { + public List databases() { return this.databases; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlManagementClientImpl.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlManagementClientImpl.java index 84996f18414..ea22aa1e1d8 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlManagementClientImpl.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/SqlManagementClientImpl.java @@ -146,19 +146,6 @@ public RestorableDroppedDatabasesInner restorableDroppedDatabases() { return this.restorableDroppedDatabases; } - /** - * The CapabilitiesInner object to access its operations. - */ - private CapabilitiesInner capabilities; - - /** - * Gets the CapabilitiesInner object to access its operations. - * @return the CapabilitiesInner object. - */ - public CapabilitiesInner capabilities() { - return this.capabilities; - } - /** * The ServersInner object to access its operations. */ @@ -185,19 +172,6 @@ public ServerConnectionPoliciesInner serverConnectionPolicies() { return this.serverConnectionPolicies; } - /** - * The DatabasesInner object to access its operations. - */ - private DatabasesInner databases; - - /** - * Gets the DatabasesInner object to access its operations. - * @return the DatabasesInner object. - */ - public DatabasesInner databases() { - return this.databases; - } - /** * The DatabaseThreatDetectionPoliciesInner object to access its operations. */ @@ -237,19 +211,6 @@ public DataMaskingRulesInner dataMaskingRules() { return this.dataMaskingRules; } - /** - * The ElasticPoolsInner object to access its operations. - */ - private ElasticPoolsInner elasticPools; - - /** - * Gets the ElasticPoolsInner object to access its operations. - * @return the ElasticPoolsInner object. - */ - public ElasticPoolsInner elasticPools() { - return this.elasticPools; - } - /** * The FirewallRulesInner object to access its operations. */ @@ -276,6 +237,45 @@ public GeoBackupPoliciesInner geoBackupPolicies() { return this.geoBackupPolicies; } + /** + * The DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The ElasticPoolsInner object to access its operations. + */ + private ElasticPoolsInner elasticPools; + + /** + * Gets the ElasticPoolsInner object to access its operations. + * @return the ElasticPoolsInner object. + */ + public ElasticPoolsInner elasticPools() { + return this.elasticPools; + } + + /** + * The RecommendedElasticPoolsInner object to access its operations. + */ + private RecommendedElasticPoolsInner recommendedElasticPools; + + /** + * Gets the RecommendedElasticPoolsInner object to access its operations. + * @return the RecommendedElasticPoolsInner object. + */ + public RecommendedElasticPoolsInner recommendedElasticPools() { + return this.recommendedElasticPools; + } + /** * The ReplicationLinksInner object to access its operations. */ @@ -354,19 +354,6 @@ public ElasticPoolDatabaseActivitiesInner elasticPoolDatabaseActivities() { return this.elasticPoolDatabaseActivities; } - /** - * The RecommendedElasticPoolsInner object to access its operations. - */ - private RecommendedElasticPoolsInner recommendedElasticPools; - - /** - * Gets the RecommendedElasticPoolsInner object to access its operations. - * @return the RecommendedElasticPoolsInner object. - */ - public RecommendedElasticPoolsInner recommendedElasticPools() { - return this.recommendedElasticPools; - } - /** * The ServiceTierAdvisorsInner object to access its operations. */ @@ -666,6 +653,19 @@ public ElasticPoolOperationsInner elasticPoolOperations() { return this.elasticPoolOperations; } + /** + * The CapabilitiesInner object to access its operations. + */ + private CapabilitiesInner capabilities; + + /** + * Gets the CapabilitiesInner object to access its operations. + * @return the CapabilitiesInner object. + */ + public CapabilitiesInner capabilities() { + return this.capabilities; + } + /** * Initializes an instance of SqlManagementClient client. * @@ -702,23 +702,22 @@ protected void initialize() { this.generateClientRequestId = true; this.recoverableDatabases = new RecoverableDatabasesInner(restClient().retrofit(), this); this.restorableDroppedDatabases = new RestorableDroppedDatabasesInner(restClient().retrofit(), this); - this.capabilities = new CapabilitiesInner(restClient().retrofit(), this); this.servers = new ServersInner(restClient().retrofit(), this); this.serverConnectionPolicies = new ServerConnectionPoliciesInner(restClient().retrofit(), this); - this.databases = new DatabasesInner(restClient().retrofit(), this); this.databaseThreatDetectionPolicies = new DatabaseThreatDetectionPoliciesInner(restClient().retrofit(), this); this.dataMaskingPolicies = new DataMaskingPoliciesInner(restClient().retrofit(), this); this.dataMaskingRules = new DataMaskingRulesInner(restClient().retrofit(), this); - this.elasticPools = new ElasticPoolsInner(restClient().retrofit(), this); this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); this.geoBackupPolicies = new GeoBackupPoliciesInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.elasticPools = new ElasticPoolsInner(restClient().retrofit(), this); + this.recommendedElasticPools = new RecommendedElasticPoolsInner(restClient().retrofit(), this); this.replicationLinks = new ReplicationLinksInner(restClient().retrofit(), this); this.serverAzureADAdministrators = new ServerAzureADAdministratorsInner(restClient().retrofit(), this); this.serverCommunicationLinks = new ServerCommunicationLinksInner(restClient().retrofit(), this); this.serviceObjectives = new ServiceObjectivesInner(restClient().retrofit(), this); this.elasticPoolActivities = new ElasticPoolActivitiesInner(restClient().retrofit(), this); this.elasticPoolDatabaseActivities = new ElasticPoolDatabaseActivitiesInner(restClient().retrofit(), this); - this.recommendedElasticPools = new RecommendedElasticPoolsInner(restClient().retrofit(), this); this.serviceTierAdvisors = new ServiceTierAdvisorsInner(restClient().retrofit(), this); this.transparentDataEncryptions = new TransparentDataEncryptionsInner(restClient().retrofit(), this); this.transparentDataEncryptionActivities = new TransparentDataEncryptionActivitiesInner(restClient().retrofit(), this); @@ -742,6 +741,7 @@ protected void initialize() { this.restorePoints = new RestorePointsInner(restClient().retrofit(), this); this.databaseOperations = new DatabaseOperationsInner(restClient().retrofit(), this); this.elasticPoolOperations = new ElasticPoolOperationsInner(restClient().retrofit(), this); + this.capabilities = new CapabilitiesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); }