deleteTemplate method

Future<DeleteTemplateResponse> deleteTemplate({
  1. required String awsAccountId,
  2. required String templateId,
  3. int? versionNumber,
})

Deletes a template.

May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the template that you're deleting.

Parameter templateId : An ID for the template you want to delete.

Parameter versionNumber : Specifies the version of the template that you want to delete. If you don't provide a version number, DeleteTemplate deletes all versions of the template.

Implementation

Future<DeleteTemplateResponse> deleteTemplate({
  required String awsAccountId,
  required String templateId,
  int? versionNumber,
}) async {
  _s.validateNumRange(
    'versionNumber',
    versionNumber,
    1,
    1152921504606846976,
  );
  final $query = <String, List<String>>{
    if (versionNumber != null) 'version-number': [versionNumber.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/templates/${Uri.encodeComponent(templateId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DeleteTemplateResponse.fromJson(response);
}