deletePackage method

Future<void> deletePackage({
  1. required String packageName,
  2. String? clientToken,
})

Deletes a specific version from a software package.

Note: All package versions must be deleted before deleting the software package.

Requires permission to access the DeletePackageVersion action.

May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter packageName : The name of the target software package.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Implementation

Future<void> deletePackage({
  required String packageName,
  String? clientToken,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/packages/${Uri.encodeComponent(packageName)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}