createMember method

Future<CreateMemberOutput> createMember({
  1. required String invitationId,
  2. required MemberConfiguration memberConfiguration,
  3. required String networkId,
  4. String? clientRequestToken,
})

Creates a member within a Managed Blockchain network.

Applies only to Hyperledger Fabric.

May throw InvalidRequestException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ResourceAlreadyExistsException. May throw ResourceNotReadyException. May throw ThrottlingException. May throw ResourceLimitExceededException. May throw InternalServiceErrorException.

Parameter invitationId : The unique identifier of the invitation that is sent to the member to join the network.

Parameter memberConfiguration : Member configuration parameters.

Parameter networkId : The unique identifier of the network in which the member is created.

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 AWS SDK or the AWS CLI.

Implementation

Future<CreateMemberOutput> createMember({
  required String invitationId,
  required MemberConfiguration memberConfiguration,
  required String networkId,
  String? clientRequestToken,
}) async {
  ArgumentError.checkNotNull(invitationId, 'invitationId');
  _s.validateStringLength(
    'invitationId',
    invitationId,
    1,
    32,
    isRequired: true,
  );
  ArgumentError.checkNotNull(memberConfiguration, 'memberConfiguration');
  ArgumentError.checkNotNull(networkId, 'networkId');
  _s.validateStringLength(
    'networkId',
    networkId,
    1,
    32,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    64,
  );
  final $payload = <String, dynamic>{
    'InvitationId': invitationId,
    'MemberConfiguration': memberConfiguration,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/networks/${Uri.encodeComponent(networkId)}/members',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMemberOutput.fromJson(response);
}