deleteTheme method
Deletes a theme.
May throw AccessDeniedException. May throw ConflictException. May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException. May throw InternalFailureException.
Parameter awsAccountId
:
The ID of the AWS account that contains the theme that you're deleting.
Parameter themeId
:
An ID for the theme that you want to delete.
Parameter versionNumber
:
The version of the theme that you want to delete.
Note: If you don't provide a version number, you're using this call
to DeleteTheme
to delete all versions of the theme.
Implementation
Future<DeleteThemeResponse> deleteTheme({
required String awsAccountId,
required String themeId,
int? versionNumber,
}) async {
ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
_s.validateStringLength(
'awsAccountId',
awsAccountId,
12,
12,
isRequired: true,
);
ArgumentError.checkNotNull(themeId, 'themeId');
_s.validateStringLength(
'themeId',
themeId,
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)}/themes/${Uri.encodeComponent(themeId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return DeleteThemeResponse.fromJson(response);
}