Skip to content

list_identity_pools async

list_identity_pools(
    max_results: QueryLimit,
    *,
    config_overrides: Optional[AsyncCognitoIdentityClientConfig] = None,
    next_token: Optional[PaginationKey] = None,
) -> ListIdentityPoolsResponse

Lists all of the Cognito identity pools registered for your account.

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

Parameters:

Raises:

Source code in docs_src/capo_cognito_identity/_services/async_cognito_identity.py
async def list_identity_pools(
    self,
    max_results: "capo_cognito_identity.types.query_limit.QueryLimit",
    *,
    config_overrides: Optional[AsyncCognitoIdentityClientConfig] = None,
    next_token: Optional[
        "capo_cognito_identity.types.pagination_key.PaginationKey"
    ] = None,
) -> "capo_cognito_identity.types.list_identity_pools_response.ListIdentityPoolsResponse":
    """<p>Lists all of the Cognito identity pools registered for your account.</p> <p>You must use Amazon Web Services developer credentials to call this operation.</p>

    Args:
        max_results: <p>The maximum number of identities to return.</p>
        next_token: <p>A pagination token.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cognito_identity.types.list_identity_pools_input.ListIdentityPoolsInput]",
    ) -> AsyncOperationResponse[
        "capo_cognito_identity.types.list_identity_pools_response.ListIdentityPoolsResponse"
    ]:
        import capo_cognito_identity._operations.aws_cognito_identity_service.list_identity_pools

        (
            output,
            http_response,
        ) = await capo_cognito_identity._operations.aws_cognito_identity_service.list_identity_pools.async_list_identity_pools(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListIdentityPools")
    )
    input_: capo_cognito_identity.types.list_identity_pools_input.ListIdentityPoolsInput = {
        "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