use of com.microsoft.azure.keyvault.models.CertificateOperation in project azure-sdk-for-java by Azure.
the class KeyVaultClientImpl method createCertificateWithServiceResponseAsync.
/**
* Creates a new certificate. If this is the first version, the certificate resource is created.
*
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param certificateName The name of the certificate.
* @return the observable to the CertificateOperation object
*/
public Observable<ServiceResponse<CertificateOperation>> createCertificateWithServiceResponseAsync(String vaultBaseUrl, String certificateName) {
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.");
}
final CertificatePolicy certificatePolicy = null;
final CertificateAttributes certificateAttributes = null;
final Map<String, String> tags = null;
CertificateCreateParameters parameters = new CertificateCreateParameters();
parameters.withCertificatePolicy(null);
parameters.withCertificateAttributes(null);
parameters.withTags(null);
String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl);
return service.createCertificate(certificateName, this.apiVersion(), this.acceptLanguage(), parameters, parameterizedHost, this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CertificateOperation>>>() {
@Override
public Observable<ServiceResponse<CertificateOperation>> call(Response<ResponseBody> response) {
try {
ServiceResponse<CertificateOperation> clientResponse = createCertificateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations