listSecurityGroups method
Retrieves a paginated list of security groups in a specified Wickr network. You can sort the results by various criteria.
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 security groups.
Parameter maxResults :
The maximum number of security groups 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 security groups by. Accepted values include 'id' and
'name'.
Implementation
Future<ListSecurityGroupsResponse> listSecurityGroups({
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',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListSecurityGroupsResponse.fromJson(response);
}