Search in sources :

Example 1 with TransparentDataEncryptionStates

use of com.microsoft.azure.management.sql.TransparentDataEncryptionStates in project azure-sdk-for-java by Azure.

the class DatabasesInner method createOrUpdateTransparentDataEncryptionConfigurationWithServiceResponseAsync.

/**
     * Creates or updates an Azure SQL Database Transparent Data Encryption Operation.
     *
     * @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 Azure SQL server.
     * @param databaseName The name of the Azure SQL database for which setting the Transparent Data Encryption applies.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the TransparentDataEncryptionInner object
     */
public Observable<ServiceResponse<TransparentDataEncryptionInner>> createOrUpdateTransparentDataEncryptionConfigurationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (serverName == null) {
        throw new IllegalArgumentException("Parameter serverName is required and cannot be null.");
    }
    if (databaseName == null) {
        throw new IllegalArgumentException("Parameter databaseName is required and cannot be null.");
    }
    final String apiVersion = "2014-04-01";
    final TransparentDataEncryptionStates status = null;
    TransparentDataEncryptionInner parameters = new TransparentDataEncryptionInner();
    parameters.withStatus(null);
    return service.createOrUpdateTransparentDataEncryptionConfiguration(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TransparentDataEncryptionInner>>>() {

        @Override
        public Observable<ServiceResponse<TransparentDataEncryptionInner>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<TransparentDataEncryptionInner> clientResponse = createOrUpdateTransparentDataEncryptionConfigurationDelegate(response);
                return Observable.just(clientResponse);
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : ServiceResponse(com.microsoft.rest.ServiceResponse) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TransparentDataEncryptionStates(com.microsoft.azure.management.sql.TransparentDataEncryptionStates) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Aggregations

TransparentDataEncryptionStates (com.microsoft.azure.management.sql.TransparentDataEncryptionStates)1 ServiceResponse (com.microsoft.rest.ServiceResponse)1 ResponseBody (okhttp3.ResponseBody)1 Response (retrofit2.Response)1 Observable (rx.Observable)1