list_devices_for_user
async
¶
list_devices_for_user(
network_id: NetworkId,
user_id: UserId,
*,
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,
) -> ListDevicesForUserResponse
Retrieves a paginated list of devices associated with a specific user in a Wickr network. This operation returns information about all devices where the user has logged into Wickr.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network containing the user.
-
user_id(UserId) –The unique identifier of the user whose devices will be listed.
-
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 devices to return in a single page. Valid range is 1-100. Default is 10.
-
sort_fields(Optional[GenericString], default:None) –The fields to sort devices by. Multiple fields can be specified by separating them with '+'. Accepted values include 'lastlogin', 'type', 'suspend', and 'created'.
-
sort_direction(Optional[SortDirection], default:None) –The direction to sort results. Valid values are 'ASC' (ascending) or 'DESC' (descending). Default is 'DESC'.
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:
Successful device list retrieval
>>> await client.list_devices_for_user(network_id='12345678', user_id='12345', max_results=10, sort_fields='appId', sort_direction='DESC')
Retrieving subsequent page of devices
>>> await client.list_devices_for_user(network_id='12345678', user_id='12345', max_results=10, next_token='v1:pagination:6ba7b810-9dad-11d1-80b4-00c04fd430c8')
Invalid userId error
Source code in docs_src/capo_wickr/_services/async_wickr.py
2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 | |