deleteCertificate method

Future<void> deleteCertificate({
  1. required String certificateArn,
})

Deletes a certificate and its associated private key. If this action succeeds, the certificate no longer appears in the list that can be displayed by calling the ListCertificates action or be retrieved by calling the GetCertificate action. The certificate will not be available for use by AWS services integrated with ACM.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidArnException.

Parameter certificateArn : String that contains the ARN of the ACM certificate to be deleted. This must be of the form:

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

For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Implementation

Future<void> deleteCertificate({
  required String certificateArn,
}) async {
  ArgumentError.checkNotNull(certificateArn, 'certificateArn');
  _s.validateStringLength(
    'certificateArn',
    certificateArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CertificateManager.DeleteCertificate'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CertificateArn': certificateArn,
    },
  );
}