listNetworks method

Future<ListNetworksOutput> listNetworks({
  1. Framework? framework,
  2. int? maxResults,
  3. String? name,
  4. String? nextToken,
  5. NetworkStatus? status,
})

Returns information about the networks in which the current AWS account participates.

Applies to Hyperledger Fabric and Ethereum.

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

Parameter framework : An optional framework specifier. If provided, only networks of this framework type are listed.

Parameter maxResults : The maximum number of networks to list.

Parameter name : The name of the network.

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

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

Applies only to Hyperledger Fabric.

Implementation

Future<ListNetworksOutput> listNetworks({
  Framework? framework,
  int? maxResults,
  String? name,
  String? nextToken,
  NetworkStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    128,
  );
  final $query = <String, List<String>>{
    if (framework != null) 'framework': [framework.toValue()],
    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',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListNetworksOutput.fromJson(response);
}