listProposalVotes method
Returns the list of votes for a specified proposal, including the value of each vote and the unique identifier of the member that cast the vote.
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.
Parameter proposalId
:
The unique identifier of the proposal.
Parameter maxResults
:
The maximum number of votes to return.
Parameter nextToken
:
The pagination token that indicates the next set of results to retrieve.
Implementation
Future<ListProposalVotesOutput> listProposalVotes({
required String networkId,
required String proposalId,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(networkId, 'networkId');
_s.validateStringLength(
'networkId',
networkId,
1,
32,
isRequired: true,
);
ArgumentError.checkNotNull(proposalId, 'proposalId');
_s.validateStringLength(
'proposalId',
proposalId,
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/${Uri.encodeComponent(proposalId)}/votes',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListProposalVotesOutput.fromJson(response);
}