createModelVersion method
Creates a version of the model using the specified model type and model id.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter modelId :
The model ID.
Parameter modelType :
The model type.
Parameter trainingDataSchema :
The training data schema.
Parameter trainingDataSource :
The training data source location in Amazon S3.
Parameter externalEventsDetail :
Details of the external events data used for model version training.
Required if trainingDataSource is
EXTERNAL_EVENTS.
Parameter ingestedEventsDetail :
Details of the ingested events data used for model version training.
Required if trainingDataSource is
INGESTED_EVENTS.
Parameter tags :
A collection of key and value pairs.
Implementation
Future<CreateModelVersionResult> createModelVersion({
required String modelId,
required ModelTypeEnum modelType,
required TrainingDataSchema trainingDataSchema,
required TrainingDataSourceEnum trainingDataSource,
ExternalEventsDetail? externalEventsDetail,
IngestedEventsDetail? ingestedEventsDetail,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSHawksNestServiceFacade.CreateModelVersion'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'modelId': modelId,
'modelType': modelType.value,
'trainingDataSchema': trainingDataSchema,
'trainingDataSource': trainingDataSource.value,
if (externalEventsDetail != null)
'externalEventsDetail': externalEventsDetail,
if (ingestedEventsDetail != null)
'ingestedEventsDetail': ingestedEventsDetail,
if (tags != null) 'tags': tags,
},
);
return CreateModelVersionResult.fromJson(jsonResponse.body);
}