updateUserProfile method

Future<void> updateUserProfile({
  1. required String iamUserArn,
  2. bool? allowSelfManagement,
  3. String? sshPublicKey,
  4. String? sshUsername,
})

Updates a specified user profile.

Required Permissions: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions.

May throw ValidationException. May throw ResourceNotFoundException.

Parameter iamUserArn : The user IAM ARN. This can also be a federated user's ARN.

Parameter allowSelfManagement : Whether users can specify their own SSH public key through the My Settings page. For more information, see Managing User Permissions.

Parameter sshPublicKey : The user's new SSH public key.

Parameter sshUsername : The user's SSH user name. The allowable characters are a-z, A-Z, 0-9, '-', and '_'. If the specified name includes other punctuation marks, AWS OpsWorks Stacks removes them. For example, my.name will be changed to myname. If you do not specify an SSH user name, AWS OpsWorks Stacks generates one from the IAM user name.

Implementation

Future<void> updateUserProfile({
  required String iamUserArn,
  bool? allowSelfManagement,
  String? sshPublicKey,
  String? sshUsername,
}) async {
  ArgumentError.checkNotNull(iamUserArn, 'iamUserArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorks_20130218.UpdateUserProfile'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IamUserArn': iamUserArn,
      if (allowSelfManagement != null)
        'AllowSelfManagement': allowSelfManagement,
      if (sshPublicKey != null) 'SshPublicKey': sshPublicKey,
      if (sshUsername != null) 'SshUsername': sshUsername,
    },
  );
}