Skip to content

get_intent_versions async

get_intent_versions(
    name: IntentName,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> GetIntentVersionsResponse

Gets information about all of the versions of an intent.

The GetIntentVersions operation returns an IntentMetadata object for each version of an intent. For example, if an intent has three numbered versions, the GetIntentVersions operation returns four IntentMetadata objects in the response, one for each numbered version and one for the $LATEST version.

The GetIntentVersions operation always returns at least one version, the $LATEST version.

This operation requires permissions for the lex:GetIntentVersions action.

Parameters:

  • name (IntentName) –

    The name of the intent for which versions should be returned.

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

    A pagination token for fetching the next page of intent versions. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of versions, specify the pagination token in the next request.

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

    The maximum number of intent versions to return in the response. The default is 10.

Raises:

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

  • InternalFailureException –

    An internal Amazon Lex error occurred. Try your request again.

  • LimitExceededException –

    The request exceeded a limit. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_lex_model_building_service/_services/async_lex_model_building_service.py
async def get_intent_versions(
    self,
    name: "capo_lex_model_building_service.types.intent_name.IntentName",
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    next_token: Optional[
        "capo_lex_model_building_service.types.next_token.NextToken"
    ] = None,
    max_results: Optional[
        "capo_lex_model_building_service.types.max_results.MaxResults"
    ] = None,
) -> "capo_lex_model_building_service.types.get_intent_versions_response.GetIntentVersionsResponse":
    """<p>Gets information about all of the versions of an intent.</p> <p>The <code>GetIntentVersions</code> operation returns an <code>IntentMetadata</code> object for each version of an intent. For example, if an intent has three numbered versions, the <code>GetIntentVersions</code> operation returns four <code>IntentMetadata</code> objects in the response, one for each numbered version and one for the <code>$LATEST</code> version. </p> <p>The <code>GetIntentVersions</code> operation always returns at least one version, the <code>$LATEST</code> version.</p> <p>This operation requires permissions for the <code>lex:GetIntentVersions</code> action.</p>

    Args:
        name: <p>The name of the intent for which versions should be returned.</p>
        next_token: <p>A pagination token for fetching the next page of intent versions. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of versions, specify the pagination token in the next request. </p>
        max_results: <p>The maximum number of intent versions to return in the response. The default is 10.</p>

    Raises:
        capo_lex_model_building_service.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.</p>
        capo_lex_model_building_service.errors.internal_failure_exception.InternalFailureException: <p>An internal Amazon Lex error occurred. Try your request again.</p>
        capo_lex_model_building_service.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a limit. Try your request again.</p>
        capo_lex_model_building_service.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource and try again.</p>
        capo_lex_model_building_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_model_building_service.types.get_intent_versions_request.GetIntentVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_model_building_service.types.get_intent_versions_response.GetIntentVersionsResponse"
    ]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_intent_versions

        (
            output,
            http_response,
        ) = await capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_intent_versions.async_get_intent_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetIntentVersions")
    )
    input_: capo_lex_model_building_service.types.get_intent_versions_request.GetIntentVersionsRequest = {
        "name": name
    }
    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