Search in sources :

Example 1 with UpdateServerCertificateResponse

use of software.amazon.awssdk.services.iam.model.UpdateServerCertificateResponse in project aws-doc-sdk-examples by awsdocs.

the class UpdateServerCertificate method updateCertificate.

// snippet-start:[iam.java2.update_server_certificate.main]
public static void updateCertificate(IamClient iam, String curName, String newName) {
    try {
        UpdateServerCertificateRequest request = UpdateServerCertificateRequest.builder().serverCertificateName(curName).newServerCertificateName(newName).build();
        UpdateServerCertificateResponse response = iam.updateServerCertificate(request);
        System.out.printf("Successfully updated server certificate to name %s", newName);
    } catch (IamException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : IamException(software.amazon.awssdk.services.iam.model.IamException) UpdateServerCertificateRequest(software.amazon.awssdk.services.iam.model.UpdateServerCertificateRequest) UpdateServerCertificateResponse(software.amazon.awssdk.services.iam.model.UpdateServerCertificateResponse)

Aggregations

IamException (software.amazon.awssdk.services.iam.model.IamException)1 UpdateServerCertificateRequest (software.amazon.awssdk.services.iam.model.UpdateServerCertificateRequest)1 UpdateServerCertificateResponse (software.amazon.awssdk.services.iam.model.UpdateServerCertificateResponse)1