Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Release History

## 4.0.0-beta.7 (Unreleased)
## 4.0.0-beta.7 (2019-12-17)
- `beginDeleteCertificate` and `beginRecoverDeletedCertificate` methods now return a poll response with a status of SUCCESSFULLY_COMPLETED when service returns 403 status.
- `CertificateClient.createIssuer` and `CertificateAsyncClient.createIssuer` now require a `CertificateIssuer` with both a name and provider.
- Removed constructor overload for `CertificateIssuer(String name, String provider)` from `CertificateIssuer` model.
- Removed `AdministratorContact` constructor overloads and introduced setters for all parameters.
- Removed `CertificateContact` constructor overloads and introduced setters for all parameters.

For details on the Azure SDK for Java (December 2019 beta) release refer to the [release announcement](https://aka.ms/azure-sdk-beta7-java).

## 4.0.0-beta.6 (2019-12-04)
For details on the Azure SDK for Java (November 2019 Preview) release refer to the [release announcement](https://aka.ms/azure-sdk-preview5-java).
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> getCertif
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public KeyVaultCertificateWithPolicy getCertificate(String certificateName) {
return client.getCertificate(certificateName).block();
return getCertificateWithResponse(certificateName, Context.NONE).getValue();
}

/**
Expand All @@ -155,18 +155,19 @@ public KeyVaultCertificateWithPolicy getCertificate(String certificateName) {
* <p><strong>Code Samples</strong></p>
* <p>Gets a specific version of the certificate in the key vault. Prints out the returned certificate details when a response has been received.</p>
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.getCertificateWithResponse#String}
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.getCertificateWithResponse#String-Context}
*
* @param certificateName The name of the certificate to retrieve, cannot be null
* @param context Additional context that is passed through the Http pipeline during the service call.
* @throws ResourceNotFoundException when a certificate with {@code certificateName} doesn't exist in the key vault.
* @throws HttpRequestException if {@code certificateName} is empty string.
* @return A {@link Response} whose {@link Response#getValue() value} contains the requested {@link KeyVaultCertificateWithPolicy certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<KeyVaultCertificateWithPolicy> getCertificateWithResponse(String certificateName) {
return client.getCertificateWithResponse(certificateName).block();
public Response<KeyVaultCertificateWithPolicy> getCertificateWithResponse(String certificateName, Context context) {
return client.getCertificateWithResponse(certificateName, "", context).block();
}

/**
* Gets information about the latest version of the specified certificate. This operation requires the certificates/get permission.
*
Expand Down Expand Up @@ -216,15 +217,15 @@ public KeyVaultCertificate getCertificateVersion(String certificateName, String
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.updateCertificateProperties#CertificateProperties}
*
* @param certificateProperties The {@link CertificateProperties} object with updated properties.
* @param properties The {@link CertificateProperties} object with updated properties.
* @throws NullPointerException if {@code certificate} is {@code null}.
* @throws ResourceNotFoundException when a certificate with {@link CertificateProperties#getName() certificateName} and {@link CertificateProperties#getVersion() version} doesn't exist in the key vault.
* @throws HttpRequestException if {@link CertificateProperties#getName() certificateName} or {@link CertificateProperties#getVersion() version} is empty string.
* @return The {@link CertificateProperties updated certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public KeyVaultCertificate updateCertificateProperties(CertificateProperties certificateProperties) {
return updateCertificatePropertiesWithResponse(certificateProperties, Context.NONE).getValue();
public KeyVaultCertificate updateCertificateProperties(CertificateProperties properties) {
return updateCertificatePropertiesWithResponse(properties, Context.NONE).getValue();
}

/**
Expand All @@ -237,16 +238,16 @@ public KeyVaultCertificate updateCertificateProperties(CertificateProperties cer
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.updateCertificatePropertiesWithResponse#CertificateProperties-Context}
*
* @param certificateProperties The {@link CertificateProperties} object with updated properties.
* @param properties The {@link CertificateProperties} object with updated properties.
* @param context Additional context that is passed through the Http pipeline during the service call.
* @throws NullPointerException if {@code certificate} is {@code null}.
* @throws ResourceNotFoundException when a certificate with {@link CertificateProperties#getName() certificateName} and {@link CertificateProperties#getVersion() version} doesn't exist in the key vault.
* @throws HttpRequestException if {@link CertificateProperties#getName() certificateName} or {@link CertificateProperties#getVersion() version} is empty string.
* @return A {@link Response} whose {@link Response#getValue() value} contains the {@link CertificateProperties updated certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<KeyVaultCertificate> updateCertificatePropertiesWithResponse(CertificateProperties certificateProperties, Context context) {
return client.updateCertificatePropertiesWithResponse(certificateProperties, context).block();
public Response<KeyVaultCertificate> updateCertificatePropertiesWithResponse(CertificateProperties properties, Context context) {
return client.updateCertificatePropertiesWithResponse(properties, context).block();
}


Expand Down Expand Up @@ -531,7 +532,7 @@ public PagedIterable<DeletedCertificate> listDeletedCertificates() {
* @return A {@link PagedIterable} containing all of the {@link DeletedCertificate deleted certificates} in the vault.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<DeletedCertificate> listDeletedCertificates(Boolean includePending, Context context) {
public PagedIterable<DeletedCertificate> listDeletedCertificates(boolean includePending, Context context) {
return new PagedIterable<>(client.listDeletedCertificates(includePending, context));
}

Expand Down Expand Up @@ -661,27 +662,6 @@ public Response<CertificatePolicy> updateCertificatePolicyWithResponse(String ce
return client.updateCertificatePolicyWithResponse(certificateName, policy, context).block();
}

/**
* Creates the specified certificate issuer. The SetCertificateIssuer operation updates the specified certificate issuer if it
* already exists or adds it if doesn't exist. This operation requires the certificates/setissuers permission.
*
* <p><strong>Code Samples</strong></p>
* <p>Creates a new certificate issuer in the key vault. Prints out the created certificate
* issuer details when a response has been received.</p>
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.createIssuer#String-String}
*
* @param issuerName The name of the certificate issuer to be created.
* @param provider The provider of the certificate issuer to be created.
* @throws ResourceModifiedException when invalid certificate issuer {@code issuerName} or {@code provider} configuration is provided.
* @throws HttpRequestException when a certificate issuer with {@code issuerName} is empty string.
* @return The created {@link CertificateIssuer certificate issuer}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CertificateIssuer createIssuer(String issuerName, String provider) {
return createIssuerWithResponse(new CertificateIssuer(issuerName, provider), Context.NONE).getValue();
}

/**
* Creates the specified certificate issuer. The SetCertificateIssuer operation updates the specified certificate issuer if it
* already exists or adds it if doesn't exist. This operation requires the certificates/setissuers permission.
Expand Down Expand Up @@ -1027,6 +1007,44 @@ public CertificateOperation deleteCertificateOperation(String certificateName) {
public Response<CertificateOperation> deleteCertificateOperationWithResponse(String certificateName, Context context) {
return client.deleteCertificateOperationWithResponse(certificateName, context).block();
}
/**
* Cancels a certificate creation operation that is already in progress. This operation requires the {@code certificates/update} permission.
*
* <p><strong>Code Samples</strong></p>
* <p>Triggers certificate creation and then cancels the certificate creation operation in the Azure Key Vault. Subscribes to the call and prints out the
* updated certificate operation details when a response has been received.</p>
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.cancelCertificateOperation#string}
*
* @param certificateName The name of the certificate which is in the process of being created.
* @throws ResourceNotFoundException when a certificate operation for a certificate with {@code name} doesn't exist in the key vault.
* @throws HttpRequestException when the {@code name} is empty string.
* @return A {@link Response} whose {@link Response#getValue() value} contains the {@link CertificateOperation cancelled certificate operation}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CertificateOperation cancelCertificateOperation(String certificateName) {
return cancelCertificateOperationWithResponse(certificateName, Context.NONE).getValue();
}

/**
* Cancels a certificate creation operation that is already in progress. This operation requires the {@code certificates/update} permission.
*
* <p><strong>Code Samples</strong></p>
* <p>Triggers certificate creation and then cancels the certificate creation operation in the Azure Key Vault. Subscribes to the call and prints out the
* updated certificate operation details when a response has been received.</p>
*
* {@codesnippet com.azure.security.keyvault.certificates.CertificateClient.cancelCertificateOperationWithResponse#string}
*
* @param certificateName The name of the certificate which is in the process of being created.
* @param context Additional context that is passed through the Http pipeline during the service call.
* @throws ResourceNotFoundException when a certificate operation for a certificate with {@code name} doesn't exist in the key vault.
* @throws HttpRequestException when the {@code name} is empty string.
* @return A {@link Response} whose {@link Response#getValue() value} contains the {@link CertificateOperation cancelled certificate operation}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CertificateOperation> cancelCertificateOperationWithResponse(String certificateName, Context context) {
return client.cancelCertificateOperationWithResponse(certificateName, context).block();
}

/**
* Merges a certificate or a certificate chain with a key pair currently available in the service. This operation requires
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ Mono<Response<KeyVaultCertificate>> getCertificate(@HostParam("url") String url,
Context context);

@Get("certificates/{certificate-name}/{certificate-version}")
@ExpectedResponses({200, 404})
@UnexpectedResponseExceptionType(code = {403}, value = ResourceModifiedException.class)
@ExpectedResponses({200, 404, 403})
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono<Response<KeyVaultCertificateWithPolicy>> getCertificatePoller(@HostParam("url") String url,
@PathParam("certificate-name") String certificateName,
Expand Down Expand Up @@ -197,7 +196,7 @@ Mono<Response<DeletedCertificate>> getDeletedCertificate(@HostParam("url") Strin
Context context);

@Get("deletedcertificates/{certificate-name}")
@ExpectedResponses({200, 404})
@ExpectedResponses({200, 403, 404})
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono<Response<DeletedCertificate>> getDeletedCertificatePoller(@HostParam("url") String url,
@PathParam("certificate-name") String certificateName,
Expand Down Expand Up @@ -431,14 +430,4 @@ Mono<Response<CertificatePolicy>> updateCertificatePolicy(@HostParam("url") Stri
@BodyParam("application/json") CertificatePolicyRequest certificatePolicyRequest,
@HeaderParam("Content-Type") String type,
Context context);

@Get("certificates/{certificate-name}/pending")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono<Response<CertificateOperation>> getPendingCertificateSigningRequest(@HostParam("url") String url,
@QueryParam("api-version") String apiVersion,
@HeaderParam("accept-language") String acceptLanguage,
@PathParam("certificate-name") String certificateName,
@HeaderParam("Content-Type") String type,
Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Represents an administrator in {@link CertificateIssuer}
*/
public final class AdministratorContact {

/**
* First name.
*/
Expand All @@ -22,7 +23,7 @@ public final class AdministratorContact {
private String lastName;

/**
* Email addresss.
* Email address.
*/
@JsonProperty(value = "email")
private String email;
Expand All @@ -33,32 +34,6 @@ public final class AdministratorContact {
@JsonProperty(value = "phone")
private String phone;

/**
* Creates an administrator of the issuer.
* @param firstName the firstName of the issuer.
* @param lastName the last name of the issuer.
* @param email the email of the issuer.
*/
public AdministratorContact(String firstName, String lastName, String email) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}

/**
* Creates an administrator of the issuer.
* @param firstName the firstName of the admin.
* @param lastName the last name of the admin.
* @param email the email of the admin.
* @param phone the contact info of the admin.
*/
public AdministratorContact(String firstName, String lastName, String email, String phone) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.phone = phone;
}

/**
* Get the first name of the admin.
* @return the first name of admin.
Expand Down Expand Up @@ -90,4 +65,44 @@ public String getEmail() {
public String getPhone() {
return phone;
}

/**
* Set the first name of the admin.
* @param firstName the first name of the admin to set.
* @return the updated AdministratorContact object itself.
*/
public AdministratorContact setFirstName(String firstName) {
this.firstName = firstName;
return this;
}

/**
* Set the last name of the admin.
* @param lastName the last name of the admin to set.
* @return the updated AdministratorContact object itself.
*/
public AdministratorContact setLastName(String lastName) {
this.lastName = lastName;
return this;
}

/**
* Set the email of the admin.
* @param email the email of the admin to set.
* @return the updated AdministratorContact object itself.
*/
public AdministratorContact setEmail(String email) {
this.email = email;
return this;
}

/**
* Set the contact of the admin.
* @param phone the enabled status to set
* @return the updated AdministratorContact object itself.
*/
public AdministratorContact setPhone(String phone) {
this.phone = phone;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public final class CertificateContact {
/**
* Email addresss.
* Email address.
*/
@JsonProperty(value = "email")
private String email;
Expand All @@ -28,32 +28,6 @@ public final class CertificateContact {
@JsonProperty(value = "phone")
private String phone;

/**
* Creates a new certificate contact.
*
* @param name The name of the contact
* @param email The email address of the contact
* @param phone The phone number of the contact.
*/
public CertificateContact(String name, String email, String phone) {
this.name = name;
this.email = email;
this.phone = phone;
}

/**
* Creates a new certificate contact.
*
* @param name The name of the contact
* @param email The email address of the contact
*/
public CertificateContact(String name, String email) {
this.name = name;
this.email = email;
}

CertificateContact() { }

/**
* Get the email address.
*
Expand All @@ -80,4 +54,34 @@ public String getName() {
public String getPhone() {
return this.phone;
}

/**
* Set the email of the contact.
* @param email the email of the contact to set
* @return the updated CertificateContact object itself.
*/
public CertificateContact setEmail(String email) {
this.email = email;
return this;
}

/**
* Set the name of the contact.
* @param name the name of the contact to set
* @return the updated CertificateContact object itself.
*/
public CertificateContact setName(String name) {
this.name = name;
return this;
}

/**
* Set the phone of the contact.
* @param phone the phone of the contact to set
* @return the updated CertificateContact object itself.
*/
public CertificateContact setPhone(String phone) {
this.phone = phone;
return this;
}
}
Loading