Skip to content

list_users async

list_users(
    collection_id: CollectionId,
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
    max_results: Optional[MaxUserResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListUsersResponse

Returns metadata of the User such as UserID in the specified collection. Anonymous User (to reserve faces without any identity) is not returned as part of this request. The results are sorted by system generated primary key ID. If the response is truncated, NextToken is returned in the response that can be used in the subsequent request to retrieve the next set of identities.

Parameters:

Raises:

Examples:

ListUsers Returns metadata of the User such as UserID in the specified collection.

>>> await client.list_users(collection_id='MyCollection')
Source code in docs_src/capo_rekognition/_services/async_rekognition.py
async def list_users(
    self,
    collection_id: "capo_rekognition.types.collection_id.CollectionId",
    *,
    config_overrides: Optional[AsyncRekognitionClientConfig] = None,
    max_results: Optional[
        "capo_rekognition.types.max_user_results.MaxUserResults"
    ] = None,
    next_token: Optional[
        "capo_rekognition.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_rekognition.types.list_users_response.ListUsersResponse":
    """<p>Returns metadata of the User such as <code>UserID</code> in the specified collection. Anonymous User (to reserve faces without any identity) is not returned as part of this request. The results are sorted by system generated primary key ID. If the response is truncated, <code>NextToken</code> is returned in the response that can be used in the subsequent request to retrieve the next set of identities.</p>

    Args:
        collection_id: <p>The ID of an existing collection.</p>
        max_results: <p>Maximum number of UsersID to return. </p>
        next_token: <p>Pagingation token to receive the next set of UsersID.</p>

    Raises:
        capo_rekognition.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform the action.</p>
        capo_rekognition.errors.internal_server_error.InternalServerError: <p>Amazon Rekognition experienced a service issue. Try your call again.</p>
        capo_rekognition.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>Pagination token in the request is not valid.</p>
        capo_rekognition.errors.invalid_parameter_exception.InvalidParameterException: <p>Input parameter violated a constraint. Validate your parameter before calling the API operation again.</p>
        capo_rekognition.errors.provisioned_throughput_exceeded_exception.ProvisionedThroughputExceededException: <p>The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.</p>
        capo_rekognition.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request cannot be found.</p>
        capo_rekognition.errors.throttling_exception.ThrottlingException: <p>Amazon Rekognition is temporarily unable to process the request. Try your call again.</p>
        capo_rekognition.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ListUsers
        Returns metadata of the User such as UserID in the specified collection.

        >>> await client.list_users(collection_id='MyCollection')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rekognition.types.list_users_request.ListUsersRequest]",
    ) -> AsyncOperationResponse[
        "capo_rekognition.types.list_users_response.ListUsersResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.list_users

        (
            output,
            http_response,
        ) = await capo_rekognition._operations.rekognition_service.list_users.async_list_users(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListUsers")
    )
    input_: capo_rekognition.types.list_users_request.ListUsersRequest = {
        "collection_id": collection_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output