createMembers method

Future<CreateMembersResponse> createMembers({
  1. required List<Account> accounts,
  2. required String graphArn,
  3. String? message,
})

Sends a request to invite the specified AWS accounts to be member accounts in the behavior graph. This operation can only be called by the master account for a behavior graph.

CreateMembers verifies the accounts and then sends invitations to the verified accounts.

The request provides the behavior graph ARN and the list of accounts to invite.

The response separates the requested accounts into two lists:

  • The accounts that CreateMembers was able to start the verification for. This list includes member accounts that are being verified, that have passed verification and are being sent an invitation, and that have failed verification.
  • The accounts that CreateMembers was unable to process. This list includes accounts that were already invited to be member accounts in the behavior graph.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException. May throw ServiceQuotaExceededException.

Parameter accounts : The list of AWS accounts to invite to become member accounts in the behavior graph. For each invited account, the account list contains the account identifier and the AWS account root user email address.

Parameter graphArn : The ARN of the behavior graph to invite the member accounts to contribute their data to.

Parameter message : Customized message text to include in the invitation email message to the invited member accounts.

Implementation

Future<CreateMembersResponse> createMembers({
  required List<Account> accounts,
  required String graphArn,
  String? message,
}) async {
  ArgumentError.checkNotNull(accounts, 'accounts');
  ArgumentError.checkNotNull(graphArn, 'graphArn');
  _s.validateStringLength(
    'message',
    message,
    1,
    1000,
  );
  final $payload = <String, dynamic>{
    'Accounts': accounts,
    'GraphArn': graphArn,
    if (message != null) 'Message': message,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/graph/members',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMembersResponse.fromJson(response);
}