acceptInvitation method

Future<void> acceptInvitation({
  1. required String invitationId,
  2. required String masterId,
})

Accepts the invitation to be a member account and be monitored by the Security Hub master account that the invitation was sent from.

This operation is only used by member accounts that are not added through Organizations.

When the member account accepts the invitation, permission is granted to the master account to view findings generated in the member account.

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

Parameter invitationId : The ID of the invitation sent from the Security Hub master account.

Parameter masterId : The account ID of the Security Hub master account that sent the invitation.

Implementation

Future<void> acceptInvitation({
  required String invitationId,
  required String masterId,
}) async {
  ArgumentError.checkNotNull(invitationId, 'invitationId');
  ArgumentError.checkNotNull(masterId, 'masterId');
  final $payload = <String, dynamic>{
    'InvitationId': invitationId,
    'MasterId': masterId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/master',
    exceptionFnMap: _exceptionFns,
  );
}