acceptInvitation method

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

This method is deprecated. Instead, use AcceptAdministratorInvitation.

The Security Hub CSPM console continues to use AcceptInvitation. It will eventually change to use AcceptAdministratorInvitation. Any IAM policies that specifically control access to this function must continue to use AcceptInvitation. You should also add AcceptAdministratorInvitation to your policies to ensure that the correct permissions are in place after the console begins to use AcceptAdministratorInvitation.

Accepts the invitation to be a member account and be monitored by the Security Hub CSPM administrator 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 administrator account to view findings generated in the member account.

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

Parameter invitationId : The identifier of the invitation sent from the Security Hub CSPM administrator account.

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

Implementation

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