deleteCertificate method
Deletes an SSL/TLS certificate for your Amazon Lightsail content delivery network (CDN) distribution.
Certificates that are currently attached to a distribution cannot be
deleted. Use the DetachCertificateFromDistribution
action to
detach a certificate from a distribution.
May throw ServiceException. May throw InvalidInputException. May throw AccessDeniedException. May throw NotFoundException. May throw UnauthenticatedException.
Parameter certificateName
:
The name of the certificate to delete.
Use the GetCertificates
action to get a list of certificate
names that you can specify.
Implementation
Future<DeleteCertificateResult> deleteCertificate({
required String certificateName,
}) async {
ArgumentError.checkNotNull(certificateName, 'certificateName');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.DeleteCertificate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'certificateName': certificateName,
},
);
return DeleteCertificateResult.fromJson(jsonResponse.body);
}