listMembers method

Future<ListMembersOutput> listMembers({
  1. required String networkId,
  2. bool? isOwned,
  3. int? maxResults,
  4. String? name,
  5. String? nextToken,
  6. MemberStatus? status,
})

Returns a list of the members in a network and properties of their configurations.

Applies only to Hyperledger Fabric.

May throw InvalidRequestException. May throw AccessDeniedException. May throw ThrottlingException. May throw InternalServiceErrorException.

Parameter networkId : The unique identifier of the network for which to list members.

Parameter isOwned : An optional Boolean value. If provided, the request is limited either to members that the current AWS account owns (true) or that other AWS accounts own (false). If omitted, all members are listed.

Parameter maxResults : The maximum number of members to return in the request.

Parameter name : The optional name of the member to list.

Parameter nextToken : The pagination token that indicates the next set of results to retrieve.

Parameter status : An optional status specifier. If provided, only members currently in this status are listed.

Implementation

Future<ListMembersOutput> listMembers({
  required String networkId,
  bool? isOwned,
  int? maxResults,
  String? name,
  String? nextToken,
  MemberStatus? status,
}) async {
  ArgumentError.checkNotNull(networkId, 'networkId');
  _s.validateStringLength(
    'networkId',
    networkId,
    1,
    32,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    128,
  );
  final $query = <String, List<String>>{
    if (isOwned != null) 'isOwned': [isOwned.toString()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (name != null) 'name': [name],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/networks/${Uri.encodeComponent(networkId)}/members',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListMembersOutput.fromJson(response);
}