deleteTemplate method

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

Deletes a template.

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

Parameter awsAccountId : The ID of the AWS 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 {
  ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
  _s.validateStringLength(
    'awsAccountId',
    awsAccountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(templateId, 'templateId');
  _s.validateStringLength(
    'templateId',
    templateId,
    1,
    2048,
    isRequired: true,
  );
  _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);
}