Skip to content

list_datasets async

list_datasets(
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListDatasetsResponse

Returns a list of datasets created using the CreateDataset operation. For each dataset, a summary of its properties, including its Amazon Resource Name (ARN), is returned. To retrieve the complete set of properties, use the ARN with the DescribeDataset operation.

Parameters:

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

    If the result of the previous request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

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

    The number of items to return in the response.

Raises:

Source code in docs_src/capo_forecast/_services/async_forecast.py
async def list_datasets(
    self,
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
    next_token: Optional["capo_forecast.types.next_token.NextToken"] = None,
    max_results: Optional["capo_forecast.types.max_results.MaxResults"] = None,
) -> "capo_forecast.types.list_datasets_response.ListDatasetsResponse":
    """<p>Returns a list of datasets created using the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDataset.html">CreateDataset</a> operation. For each dataset, a summary of its properties, including its Amazon Resource Name (ARN), is returned. To retrieve the complete set of properties, use the ARN with the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDataset.html">DescribeDataset</a> operation.</p>

    Args:
        next_token: <p>If the result of the previous request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.</p>
        max_results: <p>The number of items to return in the response.</p>

    Raises:
        capo_forecast.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The token is not valid. Tokens expire after 24 hours.</p>
        capo_forecast.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_forecast._operations.amazon_forecast.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_forecast.types.list_datasets_request.ListDatasetsRequest = {}
    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