inviteMembers method

Future<InviteMembersResponse> inviteMembers({
  1. required List<String> accountIds,
})

Invites other AWS accounts to become member accounts for the Security Hub master account that the invitation is sent from.

This operation is only used to invite accounts that do not belong to an organization. Organization accounts do not receive invitations.

Before you can use this action to invite a member, you must first use the CreateMembers action to create the member account in Security Hub.

When the account owner enables Security Hub and accepts the invitation to become a member account, the master account can view the findings generated from the member account.

May throw InternalException. May throw InvalidInputException. May throw InvalidAccessException. May throw LimitExceededException. May throw ResourceNotFoundException.

Parameter accountIds : The list of account IDs of the AWS accounts to invite to Security Hub as members.

Implementation

Future<InviteMembersResponse> inviteMembers({
  required List<String> accountIds,
}) async {
  ArgumentError.checkNotNull(accountIds, 'accountIds');
  final $payload = <String, dynamic>{
    'AccountIds': accountIds,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/members/invite',
    exceptionFnMap: _exceptionFns,
  );
  return InviteMembersResponse.fromJson(response);
}