listSecurityGroupUsers method

Future<ListSecurityGroupUsersResponse> listSecurityGroupUsers({
  1. required String groupId,
  2. required String networkId,
  3. int? maxResults,
  4. String? nextToken,
  5. SortDirection? sortDirection,
  6. String? sortFields,
})

Retrieves a paginated list of users who belong to a specific security group in a Wickr network.

May throw BadRequestError. May throw ForbiddenError. May throw InternalServerError. May throw RateLimitError. May throw ResourceNotFoundError. May throw UnauthorizedError. May throw ValidationError.

Parameter groupId : The unique identifier of the security group whose users will be listed.

Parameter networkId : The ID of the Wickr network containing the security group.

Parameter maxResults : The maximum number of users to return in a single page. Valid range is 1-100. Default is 10.

Parameter nextToken : The token for retrieving the next page of results. This is returned from a previous request when there are more results available.

Parameter sortDirection : The direction to sort results. Valid values are 'ASC' (ascending) or 'DESC' (descending). Default is 'DESC'.

Parameter sortFields : The field to sort users by. Multiple fields can be specified by separating them with '+'. Accepted values include 'username', 'firstName', and 'lastName'.

Implementation

Future<ListSecurityGroupUsersResponse> listSecurityGroupUsers({
  required String groupId,
  required String networkId,
  int? maxResults,
  String? nextToken,
  SortDirection? sortDirection,
  String? sortFields,
}) async {
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (sortDirection != null) 'sortDirection': [sortDirection.value],
    if (sortFields != null) 'sortFields': [sortFields],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/networks/${Uri.encodeComponent(networkId)}/security-groups/${Uri.encodeComponent(groupId)}/users',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListSecurityGroupUsersResponse.fromJson(response);
}