Skip to content

list_bot_analyzer_history async

list_bot_analyzer_history(
    bot_id: Id,
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    locale_id: Optional[LocaleId] = None,
    bot_version: Optional[DraftBotVersion] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListBotAnalyzerHistoryResponse

Retrieves a list of historical bot analysis executions for a specific bot. You can filter the results by locale and bot version.

The history includes all analysis executions regardless of their status, allowing you to track past analyses and their outcomes.

Parameters:

  • bot_id (Id) –

    The unique identifier of the bot.

  • locale_id (Optional[LocaleId], default: None ) –

    The locale identifier to filter the history. If not specified, returns history for all locales.

  • bot_version (Optional[DraftBotVersion], default: None ) –

    The bot version to filter the history. If not specified, defaults to DRAFT.

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

    If the response from a previous request was truncated, the nextToken value is used to retrieve the next page of history entries.

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

    The maximum number of history entries to return in the response. The default is 10.

Raises:

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • ResourceNotFoundException –

    You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.

  • ThrottlingException –

    Your request rate is too high. Reduce the frequency of requests.

  • ValidationException –

    One of the input parameters in your request isn't valid. Check the parameters and try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
async def list_bot_analyzer_history(
    self,
    bot_id: "capo_lex_models_v2.types.id.Id",
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    locale_id: Optional["capo_lex_models_v2.types.locale_id.LocaleId"] = None,
    bot_version: Optional[
        "capo_lex_models_v2.types.draft_bot_version.DraftBotVersion"
    ] = None,
    next_token: Optional["capo_lex_models_v2.types.next_token.NextToken"] = None,
    max_results: Optional["capo_lex_models_v2.types.max_results.MaxResults"] = None,
) -> "capo_lex_models_v2.types.list_bot_analyzer_history_response.ListBotAnalyzerHistoryResponse":
    """<p>Retrieves a list of historical bot analysis executions for a specific bot. You can filter the results by locale and bot version.</p> <p>The history includes all analysis executions regardless of their status, allowing you to track past analyses and their outcomes.</p>

    Args:
        bot_id: <p>The unique identifier of the bot.</p>
        locale_id: <p>The locale identifier to filter the history. If not specified, returns history for all locales.</p>
        bot_version: <p>The bot version to filter the history. If not specified, defaults to <code>DRAFT</code>.</p>
        next_token: <p>If the response from a previous request was truncated, the <code>nextToken</code> value is used to retrieve the next page of history entries.</p>
        max_results: <p>The maximum number of history entries to return in the response. The default is 10.</p>

    Raises:
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.</p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_models_v2.types.list_bot_analyzer_history_request.ListBotAnalyzerHistoryRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_models_v2.types.list_bot_analyzer_history_response.ListBotAnalyzerHistoryResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.list_bot_analyzer_history

        (
            output,
            http_response,
        ) = await capo_lex_models_v2._operations.lex_model_building_service_v2.list_bot_analyzer_history.async_list_bot_analyzer_history(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListBotAnalyzerHistory")
    )
    input_: capo_lex_models_v2.types.list_bot_analyzer_history_request.ListBotAnalyzerHistoryRequest = {
        "bot_id": bot_id
    }
    if locale_id is not None:
        input_["locale_id"] = locale_id
    if bot_version is not None:
        input_["bot_version"] = bot_version
    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