associateS3Resources method

Future<AssociateS3ResourcesResult> associateS3Resources({
  1. required List<S3ResourceClassification> s3Resources,
  2. String? memberAccountId,
})

Associates specified S3 resources with Amazon Macie Classic for monitoring and data classification. If memberAccountId isn't specified, the action associates specified S3 resources with Macie Classic for the current master account. If memberAccountId is specified, the action associates specified S3 resources with Macie Classic for the specified member account.

May throw InvalidInputException. May throw AccessDeniedException. May throw LimitExceededException. May throw InternalException.

Parameter s3Resources : The S3 resources that you want to associate with Amazon Macie Classic for monitoring and data classification.

Parameter memberAccountId : The ID of the Amazon Macie Classic member account whose resources you want to associate with Macie Classic.

Implementation

Future<AssociateS3ResourcesResult> associateS3Resources({
  required List<S3ResourceClassification> s3Resources,
  String? memberAccountId,
}) async {
  ArgumentError.checkNotNull(s3Resources, 's3Resources');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MacieService.AssociateS3Resources'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      's3Resources': s3Resources,
      if (memberAccountId != null) 'memberAccountId': memberAccountId,
    },
  );

  return AssociateS3ResourcesResult.fromJson(jsonResponse.body);
}