addAttributesToFindings method

Future<AddAttributesToFindingsResponse> addAttributesToFindings({
  1. required List<Attribute> attributes,
  2. required List<String> findingArns,
})

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

May throw InternalException. May throw InvalidInputException. May throw AccessDeniedException. May throw NoSuchEntityException. May throw ServiceTemporarilyUnavailableException.

Parameter attributes : The array of attributes that you want to assign to specified findings.

Parameter findingArns : The ARNs that specify the findings that you want to assign attributes to.

Implementation

Future<AddAttributesToFindingsResponse> addAttributesToFindings({
  required List<Attribute> attributes,
  required List<String> findingArns,
}) async {
  ArgumentError.checkNotNull(attributes, 'attributes');
  ArgumentError.checkNotNull(findingArns, 'findingArns');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'InspectorService.AddAttributesToFindings'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'attributes': attributes,
      'findingArns': findingArns,
    },
  );

  return AddAttributesToFindingsResponse.fromJson(jsonResponse.body);
}