getDataset method
Retrieves dataset metadata only. Use ?datasetVersion=DRAFT or
?datasetVersion=N to retrieve a specific version's metadata. If absent,
defaults to DRAFT (the mutable working copy). Returns
ResourceNotFoundException if the specified version is not found. Initial
state after CreateDataset: When CreateDataset completes successfully
(status transitions to ACTIVE), only a DRAFT working copy exists. No
published versions exist until CreateDatasetVersion is called. At this
point draftStatus is MODIFIED because the DRAFT has content that has never
been published. Default version behavior: When datasetVersion is
omitted, the operation returns the DRAFT working copy. To retrieve a
specific published version, pass the version number as a string (e.g.
?datasetVersion=1). State guard: Allowed for all statuses including
DELETING. Returns the dataset record with its current status so callers
can observe the deletion in progress. For paginated example IDs use
ListDatasetExamples.
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 to retrieve.
Parameter datasetVersion :
Version to retrieve: "DRAFT" or a version number. Defaults to DRAFT if
absent.
Implementation
Future<GetDatasetResponse> getDataset({
required String datasetId,
String? datasetVersion,
}) async {
final $query = <String, List<String>>{
if (datasetVersion != null) 'datasetVersion': [datasetVersion],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/datasets/${Uri.encodeComponent(datasetId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetDatasetResponse.fromJson(response);
}