updateDetectorModel method

Future<UpdateDetectorModelResponse> updateDetectorModel({
  1. required DetectorModelDefinition detectorModelDefinition,
  2. required String detectorModelName,
  3. required String roleArn,
  4. String? detectorModelDescription,
  5. 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 InternalFailureException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException.

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 {
  final $payload = <String, dynamic>{
    'detectorModelDefinition': detectorModelDefinition,
    'roleArn': roleArn,
    if (detectorModelDescription != null)
      'detectorModelDescription': detectorModelDescription,
    if (evaluationMethod != null) 'evaluationMethod': evaluationMethod.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/detector-models/${Uri.encodeComponent(detectorModelName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDetectorModelResponse.fromJson(response);
}