updateUser method

Future<UpdateUserResponse> updateUser({
  1. required String userId,
  2. ApiAccess? apiAccess,
  3. String? apiAccessPrincipalArn,
  4. String? clientToken,
  5. String? firstName,
  6. String? lastName,
  7. UserType? type,
})

Modifies the details of the specified user. You cannot update the userId for a user.

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

Parameter userId : The unique identifier for the user that you want to update.

Parameter apiAccess : The option to indicate whether the user can use the GetProgrammaticAccessCredentials API to obtain credentials that can then be used to access other FinSpace Data API operations.

  • ENABLED – The user has permissions to use the APIs.
  • DISABLED – The user does not have permissions to use any APIs.

Parameter apiAccessPrincipalArn : The ARN identifier of an AWS user or role that is allowed to call the GetProgrammaticAccessCredentials API to obtain a credentials token for a specific FinSpace user. This must be an IAM role within your FinSpace account.

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

Parameter firstName : The first name of the user.

Parameter lastName : The last name of the user.

Parameter type : The option to indicate the type of user.

  • SUPER_USER– A user with permission to all the functionality and data in FinSpace.
  • APP_USER – A user with specific permissions in FinSpace. The users are assigned permissions by adding them to a permission group.

Implementation

Future<UpdateUserResponse> updateUser({
  required String userId,
  ApiAccess? apiAccess,
  String? apiAccessPrincipalArn,
  String? clientToken,
  String? firstName,
  String? lastName,
  UserType? type,
}) async {
  final $payload = <String, dynamic>{
    if (apiAccess != null) 'apiAccess': apiAccess.value,
    if (apiAccessPrincipalArn != null)
      'apiAccessPrincipalArn': apiAccessPrincipalArn,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (firstName != null) 'firstName': firstName,
    if (lastName != null) 'lastName': lastName,
    if (type != null) 'type': type.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/user/${Uri.encodeComponent(userId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateUserResponse.fromJson(response);
}