revokeCertificate method

Future<RevokeCertificateResponse> revokeCertificate({
  1. required String certificateArn,
  2. required RevocationReason revocationReason,
})

Revokes a public ACM certificate. You can only revoke certificates that have been previously exported.

May throw AccessDeniedException. May throw ConflictException. May throw InvalidArnException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter certificateArn : The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:

arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012

Parameter revocationReason : Specifies why you revoked the certificate.

Implementation

Future<RevokeCertificateResponse> revokeCertificate({
  required String certificateArn,
  required RevocationReason revocationReason,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CertificateManager.RevokeCertificate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CertificateArn': certificateArn,
      'RevocationReason': revocationReason.value,
    },
  );

  return RevokeCertificateResponse.fromJson(jsonResponse.body);
}