deleteProduct method
Deletes the specified product.
You cannot delete a product if it was shared with you or is associated with a portfolio.
A delegated admin is authorized to invoke this command.
May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidParametersException. May throw TagOptionNotMigratedException.
Parameter id
:
The product identifier.
Parameter acceptLanguage
:
The language code.
-
en
- English (default) -
jp
- Japanese -
zh
- Chinese
Implementation
Future<void> deleteProduct({
required String id,
String? acceptLanguage,
}) async {
ArgumentError.checkNotNull(id, 'id');
_s.validateStringLength(
'id',
id,
1,
100,
isRequired: true,
);
_s.validateStringLength(
'acceptLanguage',
acceptLanguage,
0,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWS242ServiceCatalogService.DeleteProduct'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Id': id,
if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
},
);
}