listGuestUsers method

Future<ListGuestUsersResponse> listGuestUsers({
  1. required String networkId,
  2. String? billingPeriod,
  3. int? maxResults,
  4. String? nextToken,
  5. SortDirection? sortDirection,
  6. String? sortFields,
  7. String? username,
})

Retrieves a paginated list of guest users who have communicated with your Wickr network. Guest users are external users from federated networks who can communicate with network members.

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

Parameter networkId : The ID of the Wickr network from which to list guest users.

Parameter billingPeriod : Filter results to only include guest users from this billing period (e.g., '2024-01').

Parameter maxResults : The maximum number of guest 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 guest users by. Accepted values include 'username' and 'billingPeriod'.

Parameter username : Filter results to only include guest users with usernames matching this value.

Implementation

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