listMembers method

Future<ListMembersResponse> listMembers({
  1. int? maxResults,
  2. String? nextToken,
  3. bool? onlyAssociated,
})

Lists details about all member accounts for the current Security Hub master account.

The results include both member accounts that belong to an organization and member accounts that were invited manually.

May throw InternalException. May throw InvalidInputException. May throw InvalidAccessException. 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 ListMembers 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.

Parameter onlyAssociated : Specifies which member accounts to include in the response based on their relationship status with the master account. The default value is TRUE.

If OnlyAssociated is set to TRUE, the response includes member accounts whose relationship status with the master is set to ENABLED.

If OnlyAssociated is set to FALSE, the response includes all existing member accounts.

Implementation

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