diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseEdition.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseEdition.java new file mode 100644 index 00000000000..9811585086b --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/DatabaseEdition.java @@ -0,0 +1,68 @@ +/** + * 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 DatabaseEdition. + */ +public final class DatabaseEdition extends ExpandableStringEnum { + /** Static value Web for DatabaseEdition. */ + public static final DatabaseEdition WEB = fromString("Web"); + + /** Static value Business for DatabaseEdition. */ + public static final DatabaseEdition BUSINESS = fromString("Business"); + + /** Static value Basic for DatabaseEdition. */ + public static final DatabaseEdition BASIC = fromString("Basic"); + + /** Static value Standard for DatabaseEdition. */ + public static final DatabaseEdition STANDARD = fromString("Standard"); + + /** Static value Premium for DatabaseEdition. */ + public static final DatabaseEdition PREMIUM = fromString("Premium"); + + /** Static value PremiumRS for DatabaseEdition. */ + public static final DatabaseEdition PREMIUM_RS = fromString("PremiumRS"); + + /** Static value Free for DatabaseEdition. */ + public static final DatabaseEdition FREE = fromString("Free"); + + /** Static value Stretch for DatabaseEdition. */ + public static final DatabaseEdition STRETCH = fromString("Stretch"); + + /** Static value DataWarehouse for DatabaseEdition. */ + public static final DatabaseEdition DATA_WAREHOUSE = fromString("DataWarehouse"); + + /** Static value System for DatabaseEdition. */ + public static final DatabaseEdition SYSTEM = fromString("System"); + + /** Static value System2 for DatabaseEdition. */ + public static final DatabaseEdition SYSTEM2 = fromString("System2"); + + /** + * Creates or finds a DatabaseEdition from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseEdition + */ + @JsonCreator + public static DatabaseEdition fromString(String name) { + return fromString(name, DatabaseEdition.class); + } + + /** + * @return known DatabaseEdition values + */ + public static Collection values() { + return values(DatabaseEdition.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEdition.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEdition.java new file mode 100644 index 00000000000..6b7bee7af54 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/ElasticPoolEdition.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 ElasticPoolEdition. + */ +public final class ElasticPoolEdition extends ExpandableStringEnum { + /** Static value Basic for ElasticPoolEdition. */ + public static final ElasticPoolEdition BASIC = fromString("Basic"); + + /** Static value Standard for ElasticPoolEdition. */ + public static final ElasticPoolEdition STANDARD = fromString("Standard"); + + /** Static value Premium for ElasticPoolEdition. */ + public static final ElasticPoolEdition PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ElasticPoolEdition from its string representation. + * @param name a name to look for + * @return the corresponding ElasticPoolEdition + */ + @JsonCreator + public static ElasticPoolEdition fromString(String name) { + return fromString(name, ElasticPoolEdition.class); + } + + /** + * @return known ElasticPoolEdition values + */ + public static Collection values() { + return values(ElasticPoolEdition.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/RestorePointType.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/RestorePointType.java new file mode 100644 index 00000000000..ae7d96159d1 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/RestorePointType.java @@ -0,0 +1,53 @@ +/** + * 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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RestorePointType. + */ +public enum RestorePointType { + /** Enum value CONTINUOUS. */ + CONTINUOUS("CONTINUOUS"), + + /** Enum value DISCRETE. */ + DISCRETE("DISCRETE"); + + /** The actual serialized value for a RestorePointType instance. */ + private String value; + + RestorePointType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RestorePointType instance. + * + * @param value the serialized value to parse. + * @return the parsed RestorePointType object, or null if unable to parse. + */ + @JsonCreator + public static RestorePointType fromString(String value) { + RestorePointType[] items = RestorePointType.values(); + for (RestorePointType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionActivityStatus.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionActivityStatus.java new file mode 100644 index 00000000000..024e6919057 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionActivityStatus.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 TransparentDataEncryptionActivityStatus. + */ +public final class TransparentDataEncryptionActivityStatus extends ExpandableStringEnum { + /** Static value Encrypting for TransparentDataEncryptionActivityStatus. */ + public static final TransparentDataEncryptionActivityStatus ENCRYPTING = fromString("Encrypting"); + + /** Static value Decrypting for TransparentDataEncryptionActivityStatus. */ + public static final TransparentDataEncryptionActivityStatus DECRYPTING = fromString("Decrypting"); + + /** + * Creates or finds a TransparentDataEncryptionActivityStatus from its string representation. + * @param name a name to look for + * @return the corresponding TransparentDataEncryptionActivityStatus + */ + @JsonCreator + public static TransparentDataEncryptionActivityStatus fromString(String name) { + return fromString(name, TransparentDataEncryptionActivityStatus.class); + } + + /** + * @return known TransparentDataEncryptionActivityStatus values + */ + public static Collection values() { + return values(TransparentDataEncryptionActivityStatus.class); + } +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionStatus.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionStatus.java new file mode 100644 index 00000000000..44b5b48b835 --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/TransparentDataEncryptionStatus.java @@ -0,0 +1,53 @@ +/** + * 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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TransparentDataEncryptionStatus. + */ +public enum TransparentDataEncryptionStatus { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a TransparentDataEncryptionStatus instance. */ + private String value; + + TransparentDataEncryptionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TransparentDataEncryptionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed TransparentDataEncryptionStatus object, or null if unable to parse. + */ + @JsonCreator + public static TransparentDataEncryptionStatus fromString(String value) { + TransparentDataEncryptionStatus[] items = TransparentDataEncryptionStatus.values(); + for (TransparentDataEncryptionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} 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 f40acce4d36..edc075948d7 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 @@ -11,7 +11,7 @@ import org.joda.time.DateTime; import java.util.UUID; import com.microsoft.azure.management.sql.CreateMode; -import com.microsoft.azure.management.sql.DatabaseEditions; +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; @@ -165,7 +165,7 @@ public class DatabaseInner extends TrackedResourceInner { * 'System2'. */ @JsonProperty(value = "properties.edition") - private DatabaseEditions edition; + private DatabaseEdition edition; /** * The max size of the database expressed in bytes. If createMode is not @@ -481,7 +481,7 @@ public DatabaseInner withRecoveryServicesRecoveryPointResourceId(String recovery * * @return the edition value */ - public DatabaseEditions edition() { + public DatabaseEdition edition() { return this.edition; } @@ -491,7 +491,7 @@ public DatabaseEditions edition() { * @param edition the edition value to set * @return the DatabaseInner object itself. */ - public DatabaseInner withEdition(DatabaseEditions edition) { + public DatabaseInner withEdition(DatabaseEdition edition) { this.edition = edition; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseOperationsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseOperationsInner.java index a38aea96c5c..60f84b914cf 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseOperationsInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/DatabaseOperationsInner.java @@ -148,7 +148,7 @@ public Observable> cancelWithServiceResponseAsync(String r if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-03-01-preview"; + final String apiVersion = "2017-10-01-preview"; return service.cancel(resourceGroupName, serverName, databaseName, operationId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -277,7 +277,7 @@ public Observable>> listByDatabaseS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-03-01-preview"; + final String apiVersion = "2017-10-01-preview"; return service.listByDatabase(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override 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 54ab639d3ca..37603d82f0d 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 @@ -12,7 +12,7 @@ import org.joda.time.DateTime; import java.util.UUID; import com.microsoft.azure.management.sql.CreateMode; -import com.microsoft.azure.management.sql.DatabaseEditions; +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; @@ -166,7 +166,7 @@ public class DatabaseUpdateInner extends Resource { * 'System2'. */ @JsonProperty(value = "properties.edition") - private DatabaseEditions edition; + private DatabaseEdition edition; /** * The max size of the database expressed in bytes. If createMode is not @@ -493,7 +493,7 @@ public DatabaseUpdateInner withRecoveryServicesRecoveryPointResourceId(String re * * @return the edition value */ - public DatabaseEditions edition() { + public DatabaseEdition edition() { return this.edition; } @@ -503,7 +503,7 @@ public DatabaseEditions edition() { * @param edition the edition value to set * @return the DatabaseUpdateInner object itself. */ - public DatabaseUpdateInner withEdition(DatabaseEditions edition) { + public DatabaseUpdateInner withEdition(DatabaseEdition edition) { this.edition = edition; return this; } 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 b08f6904000..63340214282 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 @@ -10,7 +10,7 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.sql.ElasticPoolState; -import com.microsoft.azure.management.sql.ElasticPoolEditions; +import com.microsoft.azure.management.sql.ElasticPoolEdition; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -37,7 +37,7 @@ public class ElasticPoolInner extends TrackedResourceInner { * 'Standard', 'Premium'. */ @JsonProperty(value = "properties.edition") - private ElasticPoolEditions edition; + private ElasticPoolEdition edition; /** * The total shared DTU for the database elastic pool. @@ -101,7 +101,7 @@ public ElasticPoolState state() { * * @return the edition value */ - public ElasticPoolEditions edition() { + public ElasticPoolEdition edition() { return this.edition; } @@ -111,7 +111,7 @@ public ElasticPoolEditions edition() { * @param edition the edition value to set * @return the ElasticPoolInner object itself. */ - public ElasticPoolInner withEdition(ElasticPoolEditions edition) { + public ElasticPoolInner withEdition(ElasticPoolEdition edition) { this.edition = edition; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationInner.java new file mode 100644 index 00000000000..ca5d268f67c --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationInner.java @@ -0,0 +1,230 @@ +/** + * 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.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A elastic pool operation. + */ +@JsonFlatten +public class ElasticPoolOperationInner extends ProxyResourceInner { + /** + * The name of the elastic pool the operation is being performed on. + */ + @JsonProperty(value = "properties.elasticPoolName", access = JsonProperty.Access.WRITE_ONLY) + private String elasticPoolName; + + /** + * The name of operation. + */ + @JsonProperty(value = "properties.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The friendly name of operation. + */ + @JsonProperty(value = "properties.operationFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String operationFriendlyName; + + /** + * The percentage of the operation completed. + */ + @JsonProperty(value = "properties.percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * The name of the server. + */ + @JsonProperty(value = "properties.serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /** + * The operation start time. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The operation state. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The operation error code. + */ + @JsonProperty(value = "properties.errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /** + * The operation error description. + */ + @JsonProperty(value = "properties.errorDescription", access = JsonProperty.Access.WRITE_ONLY) + private String errorDescription; + + /** + * The operation error severity. + */ + @JsonProperty(value = "properties.errorSeverity", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorSeverity; + + /** + * Whether or not the error is a user error. + */ + @JsonProperty(value = "properties.isUserError", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isUserError; + + /** + * The estimated completion time of the operation. + */ + @JsonProperty(value = "properties.estimatedCompletionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime estimatedCompletionTime; + + /** + * The operation description. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Whether the operation can be cancelled. + */ + @JsonProperty(value = "properties.isCancellable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCancellable; + + /** + * Get the elasticPoolName value. + * + * @return the elasticPoolName value + */ + public String elasticPoolName() { + return this.elasticPoolName; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the operationFriendlyName value. + * + * @return the operationFriendlyName value + */ + public String operationFriendlyName() { + return this.operationFriendlyName; + } + + /** + * Get the percentComplete value. + * + * @return the percentComplete value + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the serverName value. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the state value. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the errorCode value. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorDescription value. + * + * @return the errorDescription value + */ + public String errorDescription() { + return this.errorDescription; + } + + /** + * Get the errorSeverity value. + * + * @return the errorSeverity value + */ + public Integer errorSeverity() { + return this.errorSeverity; + } + + /** + * Get the isUserError value. + * + * @return the isUserError value + */ + public Boolean isUserError() { + return this.isUserError; + } + + /** + * Get the estimatedCompletionTime value. + * + * @return the estimatedCompletionTime value + */ + public DateTime estimatedCompletionTime() { + return this.estimatedCompletionTime; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the isCancellable value. + * + * @return the isCancellable value + */ + public Boolean isCancellable() { + return this.isCancellable; + } + +} diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationsInner.java new file mode 100644 index 00000000000..8ecefd53cbc --- /dev/null +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolOperationsInner.java @@ -0,0 +1,413 @@ +/** + * 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.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ElasticPoolOperations. + */ +public class ElasticPoolOperationsInner { + /** The Retrofit service to perform REST calls. */ + private ElasticPoolOperationsService service; + /** The service client containing this operation class. */ + private SqlManagementClientImpl client; + + /** + * Initializes an instance of ElasticPoolOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ElasticPoolOperationsInner(Retrofit retrofit, SqlManagementClientImpl client) { + this.service = retrofit.create(ElasticPoolOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ElasticPoolOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface ElasticPoolOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.ElasticPoolOperations cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel") + Observable> cancel(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("elasticPoolName") String elasticPoolName, @Path("operationId") UUID operationId, @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.ElasticPoolOperations listByElasticPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations") + 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.ElasticPoolOperations listByElasticPoolNext" }) + @GET + Observable> listByElasticPoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Cancels the asynchronous operation on the 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 String value + * @param operationId The operation identifier. + * @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 cancel(String resourceGroupName, String serverName, String elasticPoolName, UUID operationId) { + cancelWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, operationId).toBlocking().single().body(); + } + + /** + * Cancels the asynchronous operation on the 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 String value + * @param operationId The operation identifier. + * @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 cancelAsync(String resourceGroupName, String serverName, String elasticPoolName, UUID operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, operationId), serviceCallback); + } + + /** + * Cancels the asynchronous operation on the 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 String value + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelAsync(String resourceGroupName, String serverName, String elasticPoolName, UUID operationId) { + return cancelWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, operationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the asynchronous operation on the 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 String value + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName, UUID operationId) { + 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 (operationId == null) { + throw new IllegalArgumentException("Parameter operationId 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.cancel(resourceGroupName, serverName, elasticPoolName, operationId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(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); + } + + /** + * Gets a list of operations performed on the 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 String value + * @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<ElasticPoolOperationInner> object if successful. + */ + 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(); + } + }; + } + + /** + * Gets a list of operations performed on the 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 String value + * @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(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); + } + + /** + * Gets a list of operations performed on the 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 String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolOperationInner> object + */ + 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(); + } + }); + } + + /** + * Gets a list of operations performed on the 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 String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ElasticPoolOperationInner> object + */ + 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 operations performed on the 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 String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ElasticPoolOperationInner> 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 (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."); + } + 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) { + try { + ServiceResponse> result = listByElasticPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } 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); + } + + /** + * Gets a list of operations performed on 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 PagedList<ElasticPoolOperationInner> object if successful. + */ + 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(); + } + }; + } + + /** + * Gets a list of operations performed on 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> 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); + } + + /** + * Gets a list of operations performed on 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 PagedList<ElasticPoolOperationInner> object + */ + public Observable> listByElasticPoolNextAsync(final String nextPageLink) { + return listByElasticPoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of operations performed on 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 PagedList<ElasticPoolOperationInner> object + */ + 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 operations performed on the 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<ElasticPoolOperationInner> 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."); + } + 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) { + try { + ServiceResponse> result = listByElasticPoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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/ElasticPoolUpdateInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ElasticPoolUpdateInner.java index 30485670394..649dd59994f 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 @@ -11,7 +11,7 @@ import java.util.Map; import org.joda.time.DateTime; import com.microsoft.azure.management.sql.ElasticPoolState; -import com.microsoft.azure.management.sql.ElasticPoolEditions; +import com.microsoft.azure.management.sql.ElasticPoolEdition; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -45,7 +45,7 @@ public class ElasticPoolUpdateInner extends Resource { * 'Standard', 'Premium'. */ @JsonProperty(value = "properties.edition") - private ElasticPoolEditions edition; + private ElasticPoolEdition edition; /** * The total shared DTU for the database elastic pool. @@ -122,7 +122,7 @@ public ElasticPoolState state() { * * @return the edition value */ - public ElasticPoolEditions edition() { + public ElasticPoolEdition edition() { return this.edition; } @@ -132,7 +132,7 @@ public ElasticPoolEditions edition() { * @param edition the edition value to set * @return the ElasticPoolUpdateInner object itself. */ - public ElasticPoolUpdateInner withEdition(ElasticPoolEditions edition) { + public ElasticPoolUpdateInner withEdition(ElasticPoolEdition edition) { this.edition = edition; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ImportRequestInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ImportRequestInner.java index dcde95acce0..1cc13282ce5 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ImportRequestInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ImportRequestInner.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.DatabaseEditions; +import com.microsoft.azure.management.sql.DatabaseEdition; import com.microsoft.azure.management.sql.ServiceObjectiveName; import com.fasterxml.jackson.annotation.JsonProperty; @@ -28,7 +28,7 @@ public class ImportRequestInner extends ExportRequestInner { * 'Stretch', 'DataWarehouse', 'System', 'System2'. */ @JsonProperty(value = "edition", required = true) - private DatabaseEditions edition; + private DatabaseEdition edition; /** * The name of the service objective to assign to the database. Possible @@ -76,7 +76,7 @@ public ImportRequestInner withDatabaseName(String databaseName) { * * @return the edition value */ - public DatabaseEditions edition() { + public DatabaseEdition edition() { return this.edition; } @@ -86,7 +86,7 @@ public DatabaseEditions edition() { * @param edition the edition value to set * @return the ImportRequestInner object itself. */ - public ImportRequestInner withEdition(DatabaseEditions edition) { + public ImportRequestInner withEdition(DatabaseEdition edition) { this.edition = edition; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ProxyResourceInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ProxyResourceInner.java index e86048ea61e..f0c8004921e 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ProxyResourceInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/ProxyResourceInner.java @@ -8,54 +8,10 @@ package com.microsoft.azure.management.sql.implementation; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; /** * ARM proxy resource. */ -public class ProxyResourceInner { - /** - * Resource Id. - */ - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** - * Resource name. - */ - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Resource type. - */ - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /** - * Get the id value. - * - * @return the id value - */ - public String id() { - return this.id; - } - - /** - * Get the name value. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Get the type value. - * - * @return the type value - */ - public String type() { - return this.type; - } +public class ProxyResourceInner extends Resource { } 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 655a3a94d4b..a7558c8de6d 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 @@ -8,7 +8,7 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.ElasticPoolEditions; +import com.microsoft.azure.management.sql.ElasticPoolEdition; import org.joda.time.DateTime; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,7 +25,7 @@ public class RecommendedElasticPoolInner extends ProxyResourceInner { * 'Basic', 'Standard', 'Premium'. */ @JsonProperty(value = "properties.databaseEdition", access = JsonProperty.Access.WRITE_ONLY) - private ElasticPoolEditions databaseEdition; + private ElasticPoolEdition databaseEdition; /** * The DTU for the recommended elastic pool. @@ -92,7 +92,7 @@ public class RecommendedElasticPoolInner extends ProxyResourceInner { * * @return the databaseEdition value */ - public ElasticPoolEditions databaseEdition() { + public ElasticPoolEdition databaseEdition() { return this.databaseEdition; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointInner.java index cd3880dc93b..e365d1a02d9 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointInner.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.RestorePointTypes; +import com.microsoft.azure.management.sql.RestorePointType; import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -29,7 +29,7 @@ public class RestorePointInner extends ProxyResourceInner { * 'DISCRETE'. */ @JsonProperty(value = "properties.restorePointType", access = JsonProperty.Access.WRITE_ONLY) - private RestorePointTypes restorePointType; + private RestorePointType restorePointType; /** * The earliest time to which this database can be restored. @@ -63,7 +63,7 @@ public String location() { * * @return the restorePointType value */ - public RestorePointTypes restorePointType() { + public RestorePointType restorePointType() { return this.restorePointType; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointsInner.java index 6f92c61a8b5..4893d3f1c9a 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointsInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/RestorePointsInner.java @@ -22,6 +22,7 @@ import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; +import retrofit2.http.HTTP; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.Query; @@ -71,6 +72,10 @@ interface RestorePointsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("restorePointName") String restorePointName, @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.RestorePoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("restorePointName") String restorePointName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -448,4 +453,101 @@ private ServiceResponse getDelegate(Response re .build(response); } + /** + * Deletes a restore point. + * + * @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 restorePointName The name of the restore point. + * @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, String restorePointName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName, restorePointName).toBlocking().single().body(); + } + + /** + * Deletes a restore point. + * + * @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 restorePointName The name of the restore point. + * @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, String restorePointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName, restorePointName), serviceCallback); + } + + /** + * Deletes a restore point. + * + * @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 restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String databaseName, String restorePointName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName, restorePointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a restore point. + * + * @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 restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String restorePointName) { + 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 (restorePointName == null) { + throw new IllegalArgumentException("Parameter restorePointName 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-03-01-preview"; + return service.delete(resourceGroupName, serverName, databaseName, restorePointName, this.client.subscriptionId(), 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()) + .registerError(CloudException.class) + .build(response); + } + } 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 9b452d28e44..47db4c8ca0e 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 @@ -601,19 +601,6 @@ public VirtualNetworkRulesInner virtualNetworkRules() { return this.virtualNetworkRules; } - /** - * The DatabaseOperationsInner object to access its operations. - */ - private DatabaseOperationsInner databaseOperations; - - /** - * Gets the DatabaseOperationsInner object to access its operations. - * @return the DatabaseOperationsInner object. - */ - public DatabaseOperationsInner databaseOperations() { - return this.databaseOperations; - } - /** * The ServerAutomaticTuningsInner object to access its operations. */ @@ -653,6 +640,32 @@ public RestorePointsInner restorePoints() { return this.restorePoints; } + /** + * The DatabaseOperationsInner object to access its operations. + */ + private DatabaseOperationsInner databaseOperations; + + /** + * Gets the DatabaseOperationsInner object to access its operations. + * @return the DatabaseOperationsInner object. + */ + public DatabaseOperationsInner databaseOperations() { + return this.databaseOperations; + } + + /** + * The ElasticPoolOperationsInner object to access its operations. + */ + private ElasticPoolOperationsInner elasticPoolOperations; + + /** + * Gets the ElasticPoolOperationsInner object to access its operations. + * @return the ElasticPoolOperationsInner object. + */ + public ElasticPoolOperationsInner elasticPoolOperations() { + return this.elasticPoolOperations; + } + /** * Initializes an instance of SqlManagementClient client. * @@ -724,10 +737,11 @@ protected void initialize() { this.syncMembers = new SyncMembersInner(restClient().retrofit(), this); this.subscriptionUsages = new SubscriptionUsagesInner(restClient().retrofit(), this); this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); - this.databaseOperations = new DatabaseOperationsInner(restClient().retrofit(), this); this.serverAutomaticTunings = new ServerAutomaticTuningsInner(restClient().retrofit(), this); this.serverDnsAliases = new ServerDnsAliasesInner(restClient().retrofit(), this); this.restorePoints = new RestorePointsInner(restClient().retrofit(), this); + this.databaseOperations = new DatabaseOperationsInner(restClient().retrofit(), this); + this.elasticPoolOperations = new ElasticPoolOperationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TrackedResourceInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TrackedResourceInner.java index b7d04be257b..158e4085424 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TrackedResourceInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TrackedResourceInner.java @@ -8,10 +8,64 @@ package com.microsoft.azure.management.sql.implementation; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.azure.Resource; /** * ARM tracked top level resource. */ public class TrackedResourceInner extends Resource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionActivityInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionActivityInner.java index c0c806722f2..e8e4a3e95e4 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionActivityInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionActivityInner.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.TransparentDataEncryptionActivityStates; +import com.microsoft.azure.management.sql.TransparentDataEncryptionActivityStatus; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -28,7 +28,7 @@ public class TransparentDataEncryptionActivityInner extends ProxyResourceInner { * 'Decrypting'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private TransparentDataEncryptionActivityStates status; + private TransparentDataEncryptionActivityStatus status; /** * The percent complete of the transparent data encryption scan for a @@ -51,7 +51,7 @@ public String location() { * * @return the status value */ - public TransparentDataEncryptionActivityStates status() { + public TransparentDataEncryptionActivityStatus status() { return this.status; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionInner.java index 5be5123362b..bb94013f11c 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionInner.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.sql.implementation; -import com.microsoft.azure.management.sql.TransparentDataEncryptionStates; +import com.microsoft.azure.management.sql.TransparentDataEncryptionStatus; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -28,7 +28,7 @@ public class TransparentDataEncryptionInner extends ProxyResourceInner { * include: 'Enabled', 'Disabled'. */ @JsonProperty(value = "properties.status") - private TransparentDataEncryptionStates status; + private TransparentDataEncryptionStatus status; /** * Get the location value. @@ -44,7 +44,7 @@ public String location() { * * @return the status value */ - public TransparentDataEncryptionStates status() { + public TransparentDataEncryptionStatus status() { return this.status; } @@ -54,7 +54,7 @@ public TransparentDataEncryptionStates status() { * @param status the status value to set * @return the TransparentDataEncryptionInner object itself. */ - public TransparentDataEncryptionInner withStatus(TransparentDataEncryptionStates status) { + public TransparentDataEncryptionInner withStatus(TransparentDataEncryptionStatus status) { this.status = status; return this; } diff --git a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionsInner.java b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionsInner.java index d5e2563c757..de7489584fe 100644 --- a/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionsInner.java +++ b/azure-mgmt-sql/src/main/java/com/microsoft/azure/management/sql/implementation/TransparentDataEncryptionsInner.java @@ -11,7 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; -import com.microsoft.azure.management.sql.TransparentDataEncryptionStates; +import com.microsoft.azure.management.sql.TransparentDataEncryptionStatus; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -135,7 +135,7 @@ public Observable> createOrUpdat } final String transparentDataEncryptionName = "current"; final String apiVersion = "2014-04-01"; - final TransparentDataEncryptionStates status = null; + final TransparentDataEncryptionStatus status = null; TransparentDataEncryptionInner parameters = new TransparentDataEncryptionInner(); parameters.withStatus(null); return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, transparentDataEncryptionName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) @@ -164,7 +164,7 @@ public Observable> call(Response * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TransparentDataEncryptionInner object if successful. */ - public TransparentDataEncryptionInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStates status) { + public TransparentDataEncryptionInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStatus status) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, status).toBlocking().single().body(); } @@ -179,7 +179,7 @@ public TransparentDataEncryptionInner createOrUpdate(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStates status, final ServiceCallback serviceCallback) { + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStatus status, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, status), serviceCallback); } @@ -193,7 +193,7 @@ public ServiceFuture createOrUpdateAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TransparentDataEncryptionInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStates status) { + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStatus status) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, status).map(new Func1, TransparentDataEncryptionInner>() { @Override public TransparentDataEncryptionInner call(ServiceResponse response) { @@ -212,7 +212,7 @@ public TransparentDataEncryptionInner call(ServiceResponse> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStates status) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, TransparentDataEncryptionStatus status) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); }