updateUserProfile method

Future<UpdateUserProfileResult> updateUserProfile({
  1. required String userArn,
  2. String? displayName,
  3. String? emailAddress,
  4. String? sshPublicKey,
})

Updates a user's profile in AWS CodeStar. The user profile is not project-specific. Information in the user profile is displayed wherever the user's information appears to other users in AWS CodeStar.

May throw UserProfileNotFoundException. May throw ValidationException.

Parameter userArn : The name that will be displayed as the friendly name for the user in AWS CodeStar.

Parameter displayName : The name that is displayed as the friendly name for the user in AWS CodeStar.

Parameter emailAddress : The email address that is displayed as part of the user's profile in AWS CodeStar.

Parameter sshPublicKey : The SSH public key associated with the user in AWS CodeStar. If a project owner allows the user remote access to project resources, this public key will be used along with the user's private key for SSH access.

Implementation

Future<UpdateUserProfileResult> updateUserProfile({
  required String userArn,
  String? displayName,
  String? emailAddress,
  String? sshPublicKey,
}) async {
  ArgumentError.checkNotNull(userArn, 'userArn');
  _s.validateStringLength(
    'userArn',
    userArn,
    32,
    95,
    isRequired: true,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    64,
  );
  _s.validateStringLength(
    'emailAddress',
    emailAddress,
    3,
    128,
  );
  _s.validateStringLength(
    'sshPublicKey',
    sshPublicKey,
    0,
    16384,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeStar_20170419.UpdateUserProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'userArn': userArn,
      if (displayName != null) 'displayName': displayName,
      if (emailAddress != null) 'emailAddress': emailAddress,
      if (sshPublicKey != null) 'sshPublicKey': sshPublicKey,
    },
  );

  return UpdateUserProfileResult.fromJson(jsonResponse.body);
}