list_users
async
¶
list_users(
network_id: NetworkId,
*,
config_overrides: Optional[AsyncWickrClientConfig] = None,
next_token: Optional[GenericString] = None,
max_results: Optional[int] = None,
sort_fields: Optional[GenericString] = None,
sort_direction: Optional[SortDirection] = None,
first_name: Optional[SensitiveString] = None,
last_name: Optional[SensitiveString] = None,
username: Optional[GenericString] = None,
status: Optional[UserStatus] = None,
group_id: Optional[GenericString] = None,
) -> ListUsersResponse
Retrieves a paginated list of users in a specified Wickr network. You can filter and sort the results based on various criteria such as name, status, or security group membership.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network from which to list users.
-
next_token(Optional[GenericString], default:None) –The token for retrieving the next page of results. This is returned from a previous request when there are more results available.
-
max_results(Optional[int], default:None) –The maximum number of users to return in a single page. Valid range is 1-100. Default is 10.
-
sort_fields(Optional[GenericString], default:None) –The fields to sort users by. Multiple fields can be specified by separating them with '+'. Accepted values include 'username', 'firstName', 'lastName', 'status', and 'groupId'.
-
sort_direction(Optional[SortDirection], default:None) –The direction to sort results. Valid values are 'ASC' (ascending) or 'DESC' (descending). Default is 'DESC'.
-
first_name(Optional[SensitiveString], default:None) –Filter results to only include users with first names matching this value.
-
last_name(Optional[SensitiveString], default:None) –Filter results to only include users with last names matching this value.
-
username(Optional[GenericString], default:None) –Filter results to only include users with usernames matching this value.
-
status(Optional[UserStatus], default:None) –Filter results to only include users with this status (1 for pending, 2 for active).
-
group_id(Optional[GenericString], default:None) –Filter results to only include users belonging to this security group.
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:
Get paginated list of users
>>> await client.list_users(network_id='12345678', max_results=20, sort_fields='username', sort_direction='ASC')
Filter by status and group
>>> await client.list_users(network_id='12345678', status=1, group_id='BCTY8Qhe', max_results=10)
Empty user list for network with no users
Source code in docs_src/capo_wickr/_services/async_wickr.py
2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 | |