updateDetectorModel method
- required DetectorModelDefinition detectorModelDefinition,
- required String detectorModelName,
- required String roleArn,
- String? detectorModelDescription,
- EvaluationMethod? evaluationMethod,
Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.
May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalFailureException. May throw ServiceUnavailableException.
Parameter detectorModelDefinition
:
Information that defines how a detector operates.
Parameter detectorModelName
:
The name of the detector model that is updated.
Parameter roleArn
:
The ARN of the role that grants permission to AWS IoT Events to perform
its operations.
Parameter detectorModelDescription
:
A brief description of the detector model.
Parameter evaluationMethod
:
Information about the order in which events are evaluated and how actions
are executed.
Implementation
Future<UpdateDetectorModelResponse> updateDetectorModel({
required DetectorModelDefinition detectorModelDefinition,
required String detectorModelName,
required String roleArn,
String? detectorModelDescription,
EvaluationMethod? evaluationMethod,
}) async {
ArgumentError.checkNotNull(
detectorModelDefinition, 'detectorModelDefinition');
ArgumentError.checkNotNull(detectorModelName, 'detectorModelName');
_s.validateStringLength(
'detectorModelName',
detectorModelName,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(roleArn, 'roleArn');
_s.validateStringLength(
'roleArn',
roleArn,
1,
2048,
isRequired: true,
);
_s.validateStringLength(
'detectorModelDescription',
detectorModelDescription,
0,
128,
);
final $payload = <String, dynamic>{
'detectorModelDefinition': detectorModelDefinition,
'roleArn': roleArn,
if (detectorModelDescription != null)
'detectorModelDescription': detectorModelDescription,
if (evaluationMethod != null)
'evaluationMethod': evaluationMethod.toValue(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/detector-models/${Uri.encodeComponent(detectorModelName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateDetectorModelResponse.fromJson(response);
}