deleteDatasetExamples method
Deletes specific examples by ID from DRAFT. All example IDs are validated before any deletes occur. If any ID does not exist in DRAFT, the entire batch is rejected (all-or-nothing semantics).
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter datasetId :
The unique identifier of the dataset.
Parameter exampleIds :
The IDs of the examples to delete.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If you don't specify this field, a value
is randomly generated for you. If this token matches a previous request,
the service ignores the request, but doesn't return an error. For more
information, see Ensuring
idempotency.
Implementation
Future<DeleteDatasetExamplesResponse> deleteDatasetExamples({
required String datasetId,
required List<String> exampleIds,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'exampleIds': exampleIds,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/datasets/${Uri.encodeComponent(datasetId)}/examples/delete',
exceptionFnMap: _exceptionFns,
);
return DeleteDatasetExamplesResponse.fromJson(response);
}