updateDetectorVersion method
- required String detectorId,
- required String detectorVersionId,
- required List<
String> externalModelEndpoints, - required List<
Rule> rules, - String? description,
- List<
ModelVersion> ? modelVersions, - RuleExecutionMode? ruleExecutionMode,
Updates a detector version. The detector version attributes that you can
update include models, external model endpoints, rules, rule execution
mode, and description. You can only update a DRAFT
detector
version.
May throw ValidationException. May throw ResourceNotFoundException. May throw InternalServerException. May throw ThrottlingException. May throw AccessDeniedException.
Parameter detectorId
:
The parent detector ID for the detector version you want to update.
Parameter detectorVersionId
:
The detector version ID.
Parameter externalModelEndpoints
:
The Amazon SageMaker model endpoints to include in the detector version.
Parameter rules
:
The rules to include in the detector version.
Parameter description
:
The detector version description.
Parameter modelVersions
:
The model versions to include in the detector version.
Parameter ruleExecutionMode
:
The rule execution mode to add to the detector.
If you specify FIRST_MATCHED
, Amazon Fraud Detector evaluates
rules sequentially, first to last, stopping at the first matched rule.
Amazon Fraud dectector then provides the outcomes for that single rule.
If you specifiy ALL_MATCHED
, Amazon Fraud Detector evaluates
all rules and returns the outcomes for all matched rules. You can define
and edit the rule mode at the detector version level, when it is in draft
status.
The default behavior is FIRST_MATCHED
.
Implementation
Future<void> updateDetectorVersion({
required String detectorId,
required String detectorVersionId,
required List<String> externalModelEndpoints,
required List<Rule> rules,
String? description,
List<ModelVersion>? modelVersions,
RuleExecutionMode? ruleExecutionMode,
}) async {
ArgumentError.checkNotNull(detectorId, 'detectorId');
_s.validateStringLength(
'detectorId',
detectorId,
1,
64,
isRequired: true,
);
ArgumentError.checkNotNull(detectorVersionId, 'detectorVersionId');
_s.validateStringLength(
'detectorVersionId',
detectorVersionId,
1,
5,
isRequired: true,
);
ArgumentError.checkNotNull(
externalModelEndpoints, 'externalModelEndpoints');
ArgumentError.checkNotNull(rules, 'rules');
_s.validateStringLength(
'description',
description,
1,
128,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSHawksNestServiceFacade.UpdateDetectorVersion'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'detectorId': detectorId,
'detectorVersionId': detectorVersionId,
'externalModelEndpoints': externalModelEndpoints,
'rules': rules,
if (description != null) 'description': description,
if (modelVersions != null) 'modelVersions': modelVersions,
if (ruleExecutionMode != null)
'ruleExecutionMode': ruleExecutionMode.toValue(),
},
);
}