listProposals method

Future<ListProposalsOutput> listProposals({
  1. required String networkId,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of proposals for the network.

Applies only to Hyperledger Fabric.

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

Parameter networkId : The unique identifier of the network.

Parameter maxResults : The maximum number of proposals to return.

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

Implementation

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