Skip to content

list_datasets async

list_datasets(
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
    flywheel_arn: Optional[ComprehendFlywheelArn] = None,
    filter: Optional[DatasetFilter] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxResultsInteger] = None,
) -> ListDatasetsResponse

List the datasets that you have configured in this Region. For more information about datasets, see Flywheel overview in the Amazon Comprehend Developer Guide.

Parameters:

  • flywheel_arn (Optional[ComprehendFlywheelArn], default: None ) –

    The Amazon Resource Number (ARN) of the flywheel.

  • filter (Optional[DatasetFilter], default: None ) –

    Filters the datasets to be returned in the response.

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

    Identifies the next page of results to return.

  • max_results (Optional[MaxResultsInteger], default: None ) –

    Maximum number of results to return in a response. The default is 100.

Raises:

Source code in docs_src/capo_comprehend/_services/async_comprehend.py
async def list_datasets(
    self,
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
    flywheel_arn: Optional[
        "capo_comprehend.types.comprehend_flywheel_arn.ComprehendFlywheelArn"
    ] = None,
    filter: Optional["capo_comprehend.types.dataset_filter.DatasetFilter"] = None,
    next_token: Optional["capo_comprehend.types.string.String"] = None,
    max_results: Optional[
        "capo_comprehend.types.max_results_integer.MaxResultsInteger"
    ] = None,
) -> "capo_comprehend.types.list_datasets_response.ListDatasetsResponse":
    """<p>List the datasets that you have configured in this Region. For more information about datasets, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/flywheels-about.html"> Flywheel overview</a> in the <i>Amazon Comprehend Developer Guide</i>.</p>

    Args:
        flywheel_arn: <p>The Amazon Resource Number (ARN) of the flywheel.</p>
        filter: <p>Filters the datasets to be returned in the response.</p>
        next_token: <p>Identifies the next page of results to return.</p>
        max_results: <p>Maximum number of results to return in a response. The default is 100.</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_filter_exception.InvalidFilterException: <p>The filter specified for the operation is invalid. Specify a different filter.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.too_many_requests_exception.TooManyRequestsException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_comprehend.types.list_datasets_request.ListDatasetsRequest]",
    ) -> AsyncOperationResponse[
        "capo_comprehend.types.list_datasets_response.ListDatasetsResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.list_datasets

        (
            output,
            http_response,
        ) = await capo_comprehend._operations.comprehend_20171127.list_datasets.async_list_datasets(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDatasets")
    )
    input_: capo_comprehend.types.list_datasets_request.ListDatasetsRequest = {}
    if flywheel_arn is not None:
        input_["flywheel_arn"] = flywheel_arn
    if filter is not None:
        input_["filter"] = filter
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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