createKxUser method

Future<CreateKxUserResponse> createKxUser({
  1. required String environmentId,
  2. required String iamRole,
  3. required String userName,
  4. String? clientToken,
  5. Map<String, String>? tags,
})

Creates a user in FinSpace kdb environment with an associated IAM role.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw LimitExceededException. May throw ResourceAlreadyExistsException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter environmentId : A unique identifier for the kdb environment where you want to create a user.

Parameter iamRole : The IAM role ARN that will be associated with the user.

Parameter userName : A unique identifier for the user.

Parameter clientToken : A token that ensures idempotency. This token expires in 10 minutes.

Parameter tags : A list of key-value pairs to label the user. You can add up to 50 tags to a user.

Implementation

Future<CreateKxUserResponse> createKxUser({
  required String environmentId,
  required String iamRole,
  required String userName,
  String? clientToken,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'iamRole': iamRole,
    'userName': userName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/kx/environments/${Uri.encodeComponent(environmentId)}/users',
    exceptionFnMap: _exceptionFns,
  );
  return CreateKxUserResponse.fromJson(response);
}