Search in sources :

Example 1 with CertificateOperationUpdateParameter

use of com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter in project azure-sdk-for-java by Azure.

the class KeyVaultClientImpl method updateCertificateOperationWithServiceResponseAsync.

/**
     * Updates a certificate operation.
     *
     * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
     * @param certificateName The name of the certificate.
     * @param cancellationRequested Indicates if cancellation was requested on the certificate operation.
     * @return the observable to the CertificateOperation object
     */
public Observable<ServiceResponse<CertificateOperation>> updateCertificateOperationWithServiceResponseAsync(String vaultBaseUrl, String certificateName, boolean cancellationRequested) {
    if (vaultBaseUrl == null) {
        throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null.");
    }
    if (certificateName == null) {
        throw new IllegalArgumentException("Parameter certificateName is required and cannot be null.");
    }
    if (this.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
    }
    CertificateOperationUpdateParameter certificateOperation = new CertificateOperationUpdateParameter();
    certificateOperation.withCancellationRequested(cancellationRequested);
    String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl);
    return service.updateCertificateOperation(certificateName, this.apiVersion(), this.acceptLanguage(), certificateOperation, parameterizedHost, this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CertificateOperation>>>() {

        @Override
        public Observable<ServiceResponse<CertificateOperation>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<CertificateOperation> clientResponse = updateCertificateOperationDelegate(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) CertificateOperationUpdateParameter(com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter) CertificateOperation(com.microsoft.azure.keyvault.models.CertificateOperation) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Aggregations

CertificateOperation (com.microsoft.azure.keyvault.models.CertificateOperation)1 CertificateOperationUpdateParameter (com.microsoft.azure.keyvault.models.CertificateOperationUpdateParameter)1 ServiceResponse (com.microsoft.rest.ServiceResponse)1 ResponseBody (okhttp3.ResponseBody)1 Response (retrofit2.Response)1 Observable (rx.Observable)1