update_user
async
¶
update_user(
network_id: NetworkId,
user_id: UserId,
*,
config_overrides: Optional[AsyncWickrClientConfig] = 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
>>> await 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
>>> await 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
>>> await client.update_user(network_id='12345678', user_id='99999', user_details={'firstName': 'Non', 'lastName': 'Existent', 'username': '[email protected]'})
Invalid userId error
>>> await 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/async_wickr.py
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 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 | |