deleteKey method

Future<void> deleteKey({
  1. required String keyName,
  2. bool? forceDelete,
})

Deletes the specified API key. The API key must have been deactivated more than 90 days previously.

For more information, see Use API keys to authenticate in the Amazon Location Service Developer Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter keyName : The name of the API key to delete.

Parameter forceDelete : ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter true to delete the key or to false to not preemptively delete the API key.

Valid values: true, or false.

Required: No

Implementation

Future<void> deleteKey({
  required String keyName,
  bool? forceDelete,
}) async {
  final $query = <String, List<String>>{
    if (forceDelete != null) 'forceDelete': [forceDelete.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/metadata/v0/keys/${Uri.encodeComponent(keyName)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}