putDetector method

Future<void> putDetector({
  1. required String detectorId,
  2. required String eventTypeName,
  3. String? description,
  4. List<Tag>? tags,
})

Creates or updates a detector.

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

Parameter detectorId : The detector ID.

Parameter eventTypeName : The name of the event type.

Parameter description : The description of the detector.

Parameter tags : A collection of key and value pairs.

Implementation

Future<void> putDetector({
  required String detectorId,
  required String eventTypeName,
  String? description,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.PutDetector'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'detectorId': detectorId,
      'eventTypeName': eventTypeName,
      if (description != null) 'description': description,
      if (tags != null) 'tags': tags,
    },
  );
}