listMembers method

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

Lists details about all member accounts for the current GuardDuty administrator account.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The unique ID of the detector the member is associated with.

Parameter maxResults : You can use this parameter to indicate the maximum number of items you want in the response. The default value is 50. The maximum value is 50.

Parameter nextToken : You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

Parameter onlyAssociated : Specifies whether to only return associated members or to return all members (including members who haven't been invited yet or have been disassociated).

Implementation

Future<ListMembersResponse> listMembers({
  required String detectorId,
  int? maxResults,
  String? nextToken,
  String? onlyAssociated,
}) async {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    300,
    isRequired: true,
  );
  _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],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/detector/${Uri.encodeComponent(detectorId)}/member',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListMembersResponse.fromJson(response);
}