update_user
¶
update_user(
network_id: NetworkId,
user_id: UserId,
*,
config_overrides: Optional[WickrClientConfig] = None,
user_details: Optional[UpdateUserDetails] = None,
) -> UpdateUserResponse
Updates the properties of an existing user in a Wickr network. This operation allows you to modify the user's name, password, security group membership, and invite code settings.
codeValidation, inviteCode, and inviteCodeTtl are restricted to networks under preview only.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network containing the user to update.
-
user_id(UserId) –The unique identifier of the user to update.
-
user_details(Optional[UpdateUserDetails], default:None) –An object containing the user details to be updated, such as name, password, security groups, and invite code settings.
Raises:
-
BadRequestError–The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.
-
ForbiddenError–Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.
-
InternalServerError–An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.
-
RateLimitError–The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.
-
ResourceNotFoundError–The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.
-
UnauthorizedError–The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.
-
ValidationError–One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Update user information
>>> client.update_user(network_id='12345678', user_id='12345', user_details={'firstName': 'Jonathan', 'lastName': 'Doe', 'username': '[email protected]', 'securityGroupIds': ['BCTY8Qhe', 'DEPT001']})
Update user with invite code
>>> client.update_user(network_id='12345678', user_id='12345', user_details={'firstName': 'Jane', 'lastName': 'Smith', 'username': '[email protected]', 'inviteCode': 'NEWINVITE789', 'inviteCodeTtl': 14, 'codeValidation': True})
User not found error
>>> client.update_user(network_id='12345678', user_id='99999', user_details={'firstName': 'Non', 'lastName': 'Existent', 'username': '[email protected]'})
Invalid userId error
>>> client.update_user(network_id='12345678', user_id='99999', user_details={'firstName': 'John', 'lastName': 'Doe', 'username': '[email protected]', 'securityGroupIds': ['BCTY8Qhe']})
Source code in docs_src/capo_wickr/_services/wickr.py
3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 | |