deleteModel method

Future<void> deleteModel({
  1. required String modelId,
  2. required ModelTypeEnum modelType,
})

Deletes a model.

You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.

When you delete a model, Amazon Fraud Detector permanently deletes that model from the evaluation history, and the data is no longer stored in Amazon Fraud Detector.

May throw ConflictException. May throw ValidationException. May throw InternalServerException. May throw AccessDeniedException.

Parameter modelId : The model ID of the model to delete.

Parameter modelType : The model type of the model to delete.

Implementation

Future<void> deleteModel({
  required String modelId,
  required ModelTypeEnum modelType,
}) async {
  ArgumentError.checkNotNull(modelId, 'modelId');
  _s.validateStringLength(
    'modelId',
    modelId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(modelType, 'modelType');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.DeleteModel'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'modelId': modelId,
      'modelType': modelType.toValue(),
    },
  );
}