createDataView method
Creates a Dataview for a Dataset.
May throw ConflictException.
May throw InternalServerException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter datasetId :
The unique Dataset identifier that is used to create a Dataview.
Parameter destinationTypeParams :
Options that define the destination type for the Dataview.
Parameter asOfTimestamp :
Beginning time to use for the Dataview. The value is determined as epoch
time in milliseconds. For example, the value for Monday, November 1, 2021
12:00:00 PM UTC is specified as 1635768000000.
Parameter autoUpdate :
Flag to indicate Dataview should be updated automatically.
Parameter clientToken :
A token that ensures idempotency. This token expires in 10 minutes.
Parameter partitionColumns :
Ordered set of column names used to partition data.
Parameter sortColumns :
Columns to be used for sorting the data.
Implementation
Future<CreateDataViewResponse> createDataView({
required String datasetId,
required DataViewDestinationTypeParams destinationTypeParams,
int? asOfTimestamp,
bool? autoUpdate,
String? clientToken,
List<String>? partitionColumns,
List<String>? sortColumns,
}) async {
final $payload = <String, dynamic>{
'destinationTypeParams': destinationTypeParams,
if (asOfTimestamp != null) 'asOfTimestamp': asOfTimestamp,
if (autoUpdate != null) 'autoUpdate': autoUpdate,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (partitionColumns != null) 'partitionColumns': partitionColumns,
if (sortColumns != null) 'sortColumns': sortColumns,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/datasets/${Uri.encodeComponent(datasetId)}/dataviewsv2',
exceptionFnMap: _exceptionFns,
);
return CreateDataViewResponse.fromJson(response);
}