deleteKey method

Future<DeleteKeyResponse> deleteKey({
  1. required String ifMatch,
  2. required String key,
  3. required String kvsARN,
})

Deletes the key value pair specified by the key.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter ifMatch : The current version (ETag) of the Key Value Store that you are deleting keys from, which you can get using DescribeKeyValueStore.

Parameter key : The key to delete.

Parameter kvsARN : The Amazon Resource Name (ARN) of the Key Value Store.

Implementation

Future<DeleteKeyResponse> deleteKey({
  required String ifMatch,
  required String key,
  required String kvsARN,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/key-value-stores/${Uri.encodeComponent(kvsARN)}/keys/${Uri.encodeComponent(key)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return DeleteKeyResponse(
    itemCount: ($json['ItemCount'] as int?) ?? 0,
    totalSizeInBytes: ($json['TotalSizeInBytes'] as int?) ?? 0,
    eTag: _s.extractHeaderStringValue(response.headers, 'ETag')!,
  );
}