diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/DatabasisServerSensitivityLabel.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/DatabasisServerSensitivityLabel.java index 3edcf9a484ddd..21c1e23aca524 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/DatabasisServerSensitivityLabel.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/DatabasisServerSensitivityLabel.java @@ -32,6 +32,11 @@ public interface DatabasisServerSensitivityLabel extends HasInner, Index */ String informationTypeId(); + /** + * @return the isDisabled value. + */ + Boolean isDisabled(); + /** * @return the labelId value. */ diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/SensitivityLabels.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/SensitivityLabels.java index c264a024ff3fa..c22a0cc12b3cf 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/SensitivityLabels.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/SensitivityLabels.java @@ -19,6 +19,34 @@ * Type representing SensitivityLabels. */ public interface SensitivityLabels extends SupportsCreating, HasInner { + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName); + + /** + * Disables sensitivity recommendations on a given column. + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName); + /** * Gets the sensitivity label of a given column. * diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelImpl.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelImpl.java index bcbcdd452d1a4..e2c221572a2d0 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelImpl.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelImpl.java @@ -42,6 +42,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId(); diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelModelImpl.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelModelImpl.java index 6de66ebdc06d8..6757d22ea4541 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelModelImpl.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasisServerSensitivityLabelModelImpl.java @@ -42,6 +42,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId(); diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RecommendedSensitivityLabelsInner.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RecommendedSensitivityLabelsInner.java index 30c2ce8abd92c..4bb7bd6f597bb 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RecommendedSensitivityLabelsInner.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RecommendedSensitivityLabelsInner.java @@ -58,7 +58,7 @@ public RecommendedSensitivityLabelsInner(Retrofit retrofit, SqlManagementClientI interface RecommendedSensitivityLabelsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_03_01_preview.RecommendedSensitivityLabels listByDatabase" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels") - Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("$skipToken") String skipToken, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("includeDisabledRecommendations") Boolean includeDisabledRecommendations, @Query("$skipToken") String skipToken, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_03_01_preview.RecommendedSensitivityLabels listByDatabaseNext" }) @GET @@ -176,9 +176,10 @@ public Observable>> listByDatabaseSi if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } + final Boolean includeDisabledRecommendations = null; final String skipToken = null; final String filter = null; - return service.listByDatabase(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listByDatabase(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), includeDisabledRecommendations, skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -198,6 +199,7 @@ public Observable>> call(Response>> call(Response listByDatabase(final String resourceGroupName, final String serverName, final String databaseName, final String skipToken, final String filter) { - ServiceResponse> response = listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, skipToken, filter).toBlocking().single(); + public PagedList listByDatabase(final String resourceGroupName, final String serverName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + ServiceResponse> response = listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -221,15 +223,16 @@ public Page nextPage(String nextPageLink) { * @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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. * @param skipToken the String value * @param filter An OData filter expression that filters elements in the collection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String skipToken, final String filter, final ListOperationCallback serviceCallback) { + public ServiceFuture> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, skipToken, filter), + listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -245,13 +248,14 @@ public Observable>> call(String next * @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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. * @param skipToken the String value * @param filter An OData filter expression that filters elements in the collection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<SensitivityLabelInner> object */ - public Observable> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String skipToken, final String filter) { - return listByDatabaseWithServiceResponseAsync(resourceGroupName, serverName, databaseName, skipToken, filter) + public Observable> listByDatabaseAsync(final String resourceGroupName, final String serverName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -266,13 +270,14 @@ public Page call(ServiceResponse>> listByDatabaseWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final String skipToken, final String filter) { - return listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, skipToken, filter) + public Observable>> listByDatabaseWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + return listByDatabaseSinglePageAsync(resourceGroupName, serverName, databaseName, includeDisabledRecommendations, skipToken, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -291,12 +296,13 @@ public Observable>> call(ServiceResp 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 databaseName The name of the database. + ServiceResponse> * @param includeDisabledRecommendations Specifies whether to include disabled recommendations or not. ServiceResponse> * @param skipToken the String value ServiceResponse> * @param filter An OData filter expression that filters elements in the collection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<SensitivityLabelInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByDatabaseSinglePageAsync(final String resourceGroupName, final String serverName, final String databaseName, final String skipToken, final String filter) { + public Observable>> listByDatabaseSinglePageAsync(final String resourceGroupName, final String serverName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -312,7 +318,7 @@ public Observable>> listByDatabaseSi if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listByDatabase(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listByDatabase(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), includeDisabledRecommendations, skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelImpl.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelImpl.java index 0eba2e3799436..bfcb7108dcb18 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelImpl.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelImpl.java @@ -90,6 +90,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId(); diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelInner.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelInner.java index a283349393ebf..521015f7fb240 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelInner.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelInner.java @@ -41,6 +41,14 @@ public class SensitivityLabelInner extends ProxyResource { @JsonProperty(value = "properties.informationTypeId") private String informationTypeId; + /** + * Is sensitivity recommendation disabled. Applicable for recommended + * sensitivity label only. Specifies whether the sensitivity recommendation + * on this column is disabled (dismissed) or not. + */ + @JsonProperty(value = "properties.isDisabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDisabled; + /** * Get the label name. * @@ -121,4 +129,13 @@ public SensitivityLabelInner withInformationTypeId(String informationTypeId) { return this; } + /** + * Get is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. + * + * @return the isDisabled value + */ + public Boolean isDisabled() { + return this.isDisabled; + } + } diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsImpl.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsImpl.java index 31534a7af4552..ccc8de3f6f69b 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsImpl.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsImpl.java @@ -43,6 +43,18 @@ private SensitivityLabelImpl wrapModel(String name) { return new SensitivityLabelImpl(name, this.manager()); } + @Override + public Completable enableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + SensitivityLabelsInner client = this.inner(); + return client.enableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).toCompletable(); + } + + @Override + public Completable disableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + SensitivityLabelsInner client = this.inner(); + return client.disableRecommendationAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).toCompletable(); + } + @Override public Observable getAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { SensitivityLabelsInner client = this.inner(); diff --git a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsInner.java b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsInner.java index 29f800ff8fea7..e3b212635a168 100644 --- a/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsInner.java +++ b/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/SensitivityLabelsInner.java @@ -29,6 +29,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; @@ -66,6 +67,14 @@ interface SensitivityLabelsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels") Observable> listCurrentByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_03_01_preview.SensitivityLabels enableRecommendation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable") + Observable> enableRecommendation(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_03_01_preview.SensitivityLabels disableRecommendation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable") + Observable> disableRecommendation(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_03_01_preview.SensitivityLabels get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") SensitivityLabelSource sensitivityLabelSource, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -345,6 +354,234 @@ private ServiceResponse> listCurrentByDatabaseDe .build(response); } + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 enableRecommendation(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + enableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).toBlocking().single().body(); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 enableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName), serviceCallback); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + return enableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableRecommendationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + 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 (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String sensitivityLabelSource = "recommended"; + return service.enableRecommendation(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableRecommendationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableRecommendationDelegate(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); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 disableRecommendation(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + disableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).toBlocking().single().body(); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 disableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName), serviceCallback); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableRecommendationAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + return disableRecommendationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableRecommendationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, String schemaName, String tableName, String columnName) { + 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 (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String sensitivityLabelSource = "recommended"; + return service.disableRecommendation(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableRecommendationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableRecommendationDelegate(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 the sensitivity label of a given column. * diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/CurrentSensitivityLabels.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/CurrentSensitivityLabels.java index 8f321672f8508..af197559e726b 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/CurrentSensitivityLabels.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/CurrentSensitivityLabels.java @@ -32,6 +32,11 @@ public interface CurrentSensitivityLabels extends HasInner, Inde */ String informationTypeId(); + /** + * @return the isDisabled value. + */ + Boolean isDisabled(); + /** * @return the labelId value. */ diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/CurrentSensitivityLabelsImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/CurrentSensitivityLabelsImpl.java index 6ef121d08fad5..92662821c0110 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/CurrentSensitivityLabelsImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/CurrentSensitivityLabelsImpl.java @@ -42,6 +42,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId(); diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsImpl.java index 3ba28f5128eeb..623cbddb897db 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsImpl.java @@ -82,6 +82,18 @@ public Completable deleteAsync(String resourceGroupName, String managedInstanceN return client.deleteAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).toCompletable(); } + @Override + public Completable disableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + ManagedDatabaseSensitivityLabelsInner client = this.inner(); + return client.disableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).toCompletable(); + } + + @Override + public Completable enableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + ManagedDatabaseSensitivityLabelsInner client = this.inner(); + return client.enableRecommendationAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).toCompletable(); + } + @Override public Observable listCurrentByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName) { ManagedDatabaseSensitivityLabelsInner client = this.inner(); diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsInner.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsInner.java index f8a6d9bda0a0d..b423e135f8675 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsInner.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedDatabaseSensitivityLabelsInner.java @@ -29,6 +29,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; @@ -74,13 +75,21 @@ interface ManagedDatabaseSensitivityLabelsService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @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.v2018_06_01_preview.ManagedDatabaseSensitivityLabels disableRecommendation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable") + Observable> disableRecommendation(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @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.v2018_06_01_preview.ManagedDatabaseSensitivityLabels enableRecommendation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable") + Observable> enableRecommendation(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @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.v2018_06_01_preview.ManagedDatabaseSensitivityLabels listCurrentByDatabase" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels") Observable> listCurrentByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @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.v2018_06_01_preview.ManagedDatabaseSensitivityLabels listRecommendedByDatabase" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels") - Observable> listRecommendedByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("$skipToken") String skipToken, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listRecommendedByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("includeDisabledRecommendations") Boolean includeDisabledRecommendations, @Query("$skipToken") String skipToken, @Query("$filter") String filter, @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.v2018_06_01_preview.ManagedDatabaseSensitivityLabels listCurrentByDatabaseNext" }) @GET @@ -451,6 +460,234 @@ private ServiceResponse deleteDelegate(Response response) th .build(response); } + /** + * Disables sensitivity recommendations on a given column. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 disableRecommendation(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + disableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).toBlocking().single().body(); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 disableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName), serviceCallback); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + return disableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables sensitivity recommendations on a given column. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableRecommendationWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String sensitivityLabelSource = "recommended"; + return service.disableRecommendation(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableRecommendationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableRecommendationDelegate(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); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 enableRecommendation(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + enableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).toBlocking().single().body(); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @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 enableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName), serviceCallback); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableRecommendationAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + return enableRecommendationWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param databaseName The name of the database. + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableRecommendationWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, String databaseName, String schemaName, String tableName, String columnName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String sensitivityLabelSource = "recommended"; + return service.enableRecommendation(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableRecommendationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableRecommendationDelegate(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 the sensitivity labels of a given database. * @@ -822,9 +1059,10 @@ public Observable>> listRecommendedB if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } + final Boolean includeDisabledRecommendations = null; final String skipToken = null; final String filter = null; - return service.listRecommendedByDatabase(resourceGroupName, managedInstanceName, databaseName, this.client.subscriptionId(), skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listRecommendedByDatabase(resourceGroupName, managedInstanceName, databaseName, this.client.subscriptionId(), includeDisabledRecommendations, skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -844,6 +1082,7 @@ public Observable>> call(Response>> call(Response listRecommendedByDatabase(final String resourceGroupName, final String managedInstanceName, final String databaseName, final String skipToken, final String filter) { - ServiceResponse> response = listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, skipToken, filter).toBlocking().single(); + public PagedList listRecommendedByDatabase(final String resourceGroupName, final String managedInstanceName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + ServiceResponse> response = listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -867,15 +1106,16 @@ public Page nextPage(String nextPageLink) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param managedInstanceName The name of the managed instance. * @param databaseName The name of the database. + * @param includeDisabledRecommendations Specifies whether to include disabled recommendations or not. * @param skipToken the String value * @param filter An OData filter expression that filters elements in the collection. * @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> listRecommendedByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final String skipToken, final String filter, final ListOperationCallback serviceCallback) { + public ServiceFuture> listRecommendedByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, skipToken, filter), + listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -891,13 +1131,14 @@ public Observable>> call(String next * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param managedInstanceName The name of the managed instance. * @param databaseName The name of the database. + * @param includeDisabledRecommendations Specifies whether to include disabled recommendations or not. * @param skipToken the String value * @param filter An OData filter expression that filters elements in the collection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<SensitivityLabelInner> object */ - public Observable> listRecommendedByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final String skipToken, final String filter) { - return listRecommendedByDatabaseWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, skipToken, filter) + public Observable> listRecommendedByDatabaseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + return listRecommendedByDatabaseWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -912,13 +1153,14 @@ public Page call(ServiceResponse>> listRecommendedByDatabaseWithServiceResponseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final String skipToken, final String filter) { - return listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, skipToken, filter) + public Observable>> listRecommendedByDatabaseWithServiceResponseAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { + return listRecommendedByDatabaseSinglePageAsync(resourceGroupName, managedInstanceName, databaseName, includeDisabledRecommendations, skipToken, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -937,12 +1179,13 @@ public Observable>> call(ServiceResp ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. ServiceResponse> * @param managedInstanceName The name of the managed instance. ServiceResponse> * @param databaseName The name of the database. + ServiceResponse> * @param includeDisabledRecommendations Specifies whether to include disabled recommendations or not. ServiceResponse> * @param skipToken the String value ServiceResponse> * @param filter An OData filter expression that filters elements in the collection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<SensitivityLabelInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listRecommendedByDatabaseSinglePageAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final String skipToken, final String filter) { + public Observable>> listRecommendedByDatabaseSinglePageAsync(final String resourceGroupName, final String managedInstanceName, final String databaseName, final Boolean includeDisabledRecommendations, final String skipToken, final String filter) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -958,7 +1201,7 @@ public Observable>> listRecommendedB if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listRecommendedByDatabase(resourceGroupName, managedInstanceName, databaseName, this.client.subscriptionId(), skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listRecommendedByDatabase(resourceGroupName, managedInstanceName, databaseName, this.client.subscriptionId(), includeDisabledRecommendations, skipToken, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/RecommendedSensitivityLabelsImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/RecommendedSensitivityLabelsImpl.java index 52c4331fad998..e03ec0a134523 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/RecommendedSensitivityLabelsImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/RecommendedSensitivityLabelsImpl.java @@ -42,6 +42,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId(); diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelInner.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelInner.java index d4ea2c6db5edf..335d99c89f038 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelInner.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelInner.java @@ -41,6 +41,14 @@ public class SensitivityLabelInner extends ProxyResource { @JsonProperty(value = "properties.informationTypeId") private String informationTypeId; + /** + * Is sensitivity recommendation disabled. Applicable for recommended + * sensitivity label only. Specifies whether the sensitivity recommendation + * on this column is disabled (dismissed) or not. + */ + @JsonProperty(value = "properties.isDisabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDisabled; + /** * Get the label name. * @@ -121,4 +129,13 @@ public SensitivityLabelInner withInformationTypeId(String informationTypeId) { return this; } + /** + * Get is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. + * + * @return the isDisabled value + */ + public Boolean isDisabled() { + return this.isDisabled; + } + } diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelsImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelsImpl.java index b36858147102e..214ab47757cd8 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelsImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SensitivityLabelsImpl.java @@ -90,6 +90,11 @@ public String informationTypeId() { return this.inner().informationTypeId(); } + @Override + public Boolean isDisabled() { + return this.inner().isDisabled(); + } + @Override public String labelId() { return this.inner().labelId();