updateFindingsFilter method

Future<UpdateFindingsFilterResponse> updateFindingsFilter({
  1. required String id,
  2. FindingsFilterAction? action,
  3. String? clientToken,
  4. String? description,
  5. FindingCriteria? findingCriteria,
  6. String? name,
  7. int? position,
})

Updates the criteria and other settings for a findings filter.

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

Parameter id : The unique identifier for the Amazon Macie resource that the request applies to.

Parameter action : The action to perform on findings that match the filter criteria (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) the findings; and, NOOP, don't perform any action on the findings.

Parameter clientToken : A unique, case-sensitive token that you provide to ensure the idempotency of the request.

Parameter description : A custom description of the filter. The description can contain as many as 512 characters.

We strongly recommend that you avoid including any sensitive data in the description of a filter. Other users of your account might be able to see this description, depending on the actions that they're allowed to perform in Amazon Macie.

Parameter findingCriteria : The criteria to use to filter findings.

Parameter name : A custom name for the filter. The name must contain at least 3 characters and can contain as many as 64 characters.

We strongly recommend that you avoid including any sensitive data in the name of a filter. Other users of your account might be able to see this name, depending on the actions that they're allowed to perform in Amazon Macie.

Parameter position : The position of the filter in the list of saved filters on the Amazon Macie console. This value also determines the order in which the filter is applied to findings, relative to other filters that are also applied to the findings.

Implementation

Future<UpdateFindingsFilterResponse> updateFindingsFilter({
  required String id,
  FindingsFilterAction? action,
  String? clientToken,
  String? description,
  FindingCriteria? findingCriteria,
  String? name,
  int? position,
}) async {
  final $payload = <String, dynamic>{
    if (action != null) 'action': action.value,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (findingCriteria != null) 'findingCriteria': findingCriteria,
    if (name != null) 'name': name,
    if (position != null) 'position': position,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/findingsfilters/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateFindingsFilterResponse.fromJson(response);
}