listInvitations method

Future<ListInvitationsResponse> listInvitations({
  1. int? maxResults,
  2. String? nextToken,
})
Lists all Security Hub CSPM membership invitations that were sent to the calling account.

Only accounts that are managed by invitation can use this operation. Accounts that are managed using the integration with Organizations don't receive invitations.

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

Parameter maxResults : The maximum number of items to return in the response.

Parameter nextToken : The token that is required for pagination. On your first call to the ListInvitations operation, set the value of this parameter to NULL.

For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

Implementation

Future<ListInvitationsResponse> listInvitations({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/invitations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInvitationsResponse.fromJson(response);
}