Search in sources :

Example 86 with Response

use of org.wicketstuff.select2.Response in project azure-sdk-for-java by Azure.

the class TopicsInner method regenerateKeysWithServiceResponseAsync.

/**
     * Regenerates primary or secondary connection strings for the topic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param namespaceName The namespace name
     * @param topicName The topic name.
     * @param authorizationRuleName The authorizationrule name.
     * @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the ResourceListKeysInner object
     */
public Observable<ServiceResponse<ResourceListKeysInner>> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String topicName, String authorizationRuleName, Policykey policykey) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (namespaceName == null) {
        throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
    }
    if (topicName == null) {
        throw new IllegalArgumentException("Parameter topicName is required and cannot be null.");
    }
    if (authorizationRuleName == null) {
        throw new IllegalArgumentException("Parameter authorizationRuleName 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.");
    }
    RegenerateKeysParameters parameters = new RegenerateKeysParameters();
    parameters.withPolicykey(policykey);
    return service.regenerateKeys(resourceGroupName, namespaceName, topicName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {

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

Example 87 with Response

use of org.wicketstuff.select2.Response 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)

Example 88 with Response

use of org.wicketstuff.select2.Response in project azure-sdk-for-java by Azure.

the class MockIntegrationTestBase method recordRequestAndResponse.

private Response recordRequestAndResponse(Interceptor.Chain chain) throws IOException {
    Request request = chain.request();
    NetworkCallRecord networkCallRecord = new NetworkCallRecord();
    networkCallRecord.Headers = new HashMap<>();
    try {
        if (request.header("Content-Type") != null) {
            networkCallRecord.Headers.put("Content-Type", request.header("Content-Type"));
        }
        if (request.header("x-ms-version") != null) {
            networkCallRecord.Headers.put("x-ms-version", request.header("x-ms-version"));
        }
        if (request.header("User-Agent") != null) {
            networkCallRecord.Headers.put("User-Agent", request.header("User-Agent"));
        }
        networkCallRecord.Method = request.method();
        networkCallRecord.Uri = applyRegex(request.url().toString().replaceAll("\\?$", ""));
    } catch (Exception e) {
    }
    Response response = chain.proceed(chain.request());
    networkCallRecord.Response = new HashMap<>();
    try {
        networkCallRecord.Response.put("StatusCode", Integer.toString(response.code()));
        extractResponseData(networkCallRecord.Response, response);
        // remove pre-added header if this is a waiting or redirection
        if (networkCallRecord.Response.get("Body").contains("<Status>InProgress</Status>") || Integer.parseInt(networkCallRecord.Response.get("StatusCode")) == HttpStatus.SC_TEMPORARY_REDIRECT) {
        } else {
            synchronized (testRecord.networkCallRecords) {
                testRecord.networkCallRecords.add(networkCallRecord);
            }
        }
    } catch (Exception e) {
    }
    return response;
}
Also used : Response(okhttp3.Response) Request(okhttp3.Request) IOException(java.io.IOException)

Example 89 with Response

use of org.wicketstuff.select2.Response in project azure-sdk-for-java by Azure.

the class NamespacesInner method regenerateKeysWithServiceResponseAsync.

/**
     * Regenerates the primary or secondary connection strings for the namespace.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param namespaceName The namespace name
     * @param authorizationRuleName The authorizationrule name.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the ResourceListKeysInner object
     */
public Observable<ServiceResponse<ResourceListKeysInner>> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (namespaceName == null) {
        throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
    }
    if (authorizationRuleName == null) {
        throw new IllegalArgumentException("Parameter authorizationRuleName 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 Policykey policykey = null;
    RegenerateKeysParameters parameters = new RegenerateKeysParameters();
    parameters.withPolicykey(null);
    return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {

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

Example 90 with Response

use of org.wicketstuff.select2.Response in project azure-sdk-for-java by Azure.

the class NamespacesInner method regenerateKeysWithServiceResponseAsync.

/**
     * Regenerates the primary or secondary connection strings for the namespace.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param namespaceName The namespace name
     * @param authorizationRuleName The authorizationrule name.
     * @param policykey Key that needs to be regenerated. Possible values include: 'PrimaryKey', 'SecondaryKey'
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the ResourceListKeysInner object
     */
public Observable<ServiceResponse<ResourceListKeysInner>> regenerateKeysWithServiceResponseAsync(String resourceGroupName, String namespaceName, String authorizationRuleName, Policykey policykey) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (namespaceName == null) {
        throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null.");
    }
    if (authorizationRuleName == null) {
        throw new IllegalArgumentException("Parameter authorizationRuleName 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.");
    }
    RegenerateKeysParameters parameters = new RegenerateKeysParameters();
    parameters.withPolicykey(policykey);
    return service.regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceListKeysInner>>>() {

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

Aggregations

Response (okhttp3.Response)1402 Request (okhttp3.Request)993 IOException (java.io.IOException)526 Test (org.junit.Test)418 Response (retrofit2.Response)337 OkHttpClient (okhttp3.OkHttpClient)275 Call (okhttp3.Call)274 ResponseBody (okhttp3.ResponseBody)237 ServiceResponse (com.microsoft.rest.ServiceResponse)179 MockResponse (okhttp3.mockwebserver.MockResponse)148 RequestBody (okhttp3.RequestBody)142 Callback (okhttp3.Callback)123 Observable (rx.Observable)114 List (java.util.List)111 HttpUrl (okhttp3.HttpUrl)86 JSONObject (org.json.JSONObject)85 ANResponse (com.androidnetworking.common.ANResponse)84 ArrayList (java.util.ArrayList)84 AtomicReference (java.util.concurrent.atomic.AtomicReference)79 ANError (com.androidnetworking.error.ANError)77