createDatasetVersion method
Publishes the current DRAFT as a new numbered version. The DRAFT is
preserved and remains editable after publishing. Returns immediately with
status UPDATING. Poll GetDataset until status transitions to
ACTIVE or UPDATE_FAILED.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter datasetId :
The unique identifier of the dataset to publish a version for.
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<CreateDatasetVersionResponse> createDatasetVersion({
required String datasetId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/datasets/${Uri.encodeComponent(datasetId)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateDatasetVersionResponse.fromJson(response);
}