createProposal method
Creates a proposal for a change to the network that other members of the network can vote on, for example, a proposal to add a new member to the network. Any member can create a proposal.
Applies only to Hyperledger Fabric.
May throw AccessDeniedException.
May throw InternalServiceErrorException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ResourceNotReadyException.
May throw ThrottlingException.
May throw TooManyTagsException.
Parameter actions :
The type of actions proposed, such as inviting a member or removing a
member. The types of Actions in a proposal are mutually
exclusive. For example, a proposal with Invitations actions
cannot also contain Removals actions.
Parameter memberId :
The unique identifier of the member that is creating the proposal. This
identifier is especially useful for identifying the member making the
proposal when multiple members exist in a single Amazon Web Services
account.
Parameter networkId :
The unique identifier of the network for which the proposal is made.
Parameter clientRequestToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the operation. An idempotent operation completes no more
than one time. This identifier is required only if you make a service
request directly using an HTTP client. It is generated automatically if
you use an Amazon Web Services SDK or the CLI.
Parameter description :
A description for the proposal that is visible to voting members, for
example, "Proposal to add Example Corp. as member."
Parameter tags :
Tags to assign to the proposal.
Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.
For more information about tags, see Tagging Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide.
Implementation
Future<CreateProposalOutput> createProposal({
required ProposalActions actions,
required String memberId,
required String networkId,
String? clientRequestToken,
String? description,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Actions': actions,
'MemberId': memberId,
'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/networks/${Uri.encodeComponent(networkId)}/proposals',
exceptionFnMap: _exceptionFns,
);
return CreateProposalOutput.fromJson(response);
}