Skip to content

list_identities

list_identities(
    identity_pool_id: IdentityPoolId,
    max_results: QueryLimit,
    *,
    config_overrides: Optional[CognitoIdentityClientConfig] = None,
    next_token: Optional[PaginationKey] = None,
    hide_disabled: Optional[HideDisabled] = None,
) -> ListIdentitiesResponse

Lists the identities in an identity pool.

You must use Amazon Web Services developer credentials to call this operation.

Parameters:

  • identity_pool_id (IdentityPoolId) –

    An identity pool ID in the format REGION:GUID.

  • max_results (QueryLimit) –

    The maximum number of identities to return.

  • next_token (Optional[PaginationKey], default: None ) –

    A pagination token.

  • hide_disabled (Optional[HideDisabled], default: None ) –

    An optional boolean parameter that allows you to hide disabled identities. If omitted, the ListIdentities API will include disabled identities in the response.

Raises:

Source code in docs_src/capo_cognito_identity/_services/cognito_identity.py
def list_identities(
    self,
    identity_pool_id: "capo_cognito_identity.types.identity_pool_id.IdentityPoolId",
    max_results: "capo_cognito_identity.types.query_limit.QueryLimit",
    *,
    config_overrides: Optional[CognitoIdentityClientConfig] = None,
    next_token: Optional[
        "capo_cognito_identity.types.pagination_key.PaginationKey"
    ] = None,
    hide_disabled: Optional[
        "capo_cognito_identity.types.hide_disabled.HideDisabled"
    ] = None,
) -> "capo_cognito_identity.types.list_identities_response.ListIdentitiesResponse":
    """<p>Lists the identities in an identity pool.</p> <p>You must use Amazon Web Services developer credentials to call this operation.</p>

    Args:
        identity_pool_id: <p>An identity pool ID in the format REGION:GUID.</p>
        max_results: <p>The maximum number of identities to return.</p>
        next_token: <p>A pagination token.</p>
        hide_disabled: <p>An optional boolean parameter that allows you to hide disabled identities. If omitted, the ListIdentities API will include disabled identities in the response.</p>

    Raises:
        capo_cognito_identity.errors.internal_error_exception.InternalErrorException: <p>Thrown when the service encounters an error during processing the request.</p>
        capo_cognito_identity.errors.invalid_parameter_exception.InvalidParameterException: <p>Thrown for missing or bad input parameter(s).</p>
        capo_cognito_identity.errors.not_authorized_exception.NotAuthorizedException: <p>Thrown when a user is not authorized to access the requested resource.</p>
        capo_cognito_identity.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when the requested resource (for example, a dataset or record) does not exist.</p>
        capo_cognito_identity.errors.too_many_requests_exception.TooManyRequestsException: <p>Thrown when a request is throttled.</p>
        capo_cognito_identity.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cognito_identity.types.list_identities_input.ListIdentitiesInput]",
    ) -> OperationResponse[
        "capo_cognito_identity.types.list_identities_response.ListIdentitiesResponse"
    ]:
        import capo_cognito_identity._operations.aws_cognito_identity_service.list_identities

        output, http_response = (
            capo_cognito_identity._operations.aws_cognito_identity_service.list_identities.list_identities(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListIdentities")
    )
    input_: capo_cognito_identity.types.list_identities_input.ListIdentitiesInput = {
        "identity_pool_id": identity_pool_id,
        "max_results": max_results,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if hide_disabled is not None:
        input_["hide_disabled"] = hide_disabled

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output