Skip to content

delete_bot_alias async

delete_bot_alias(
    name: AliasName,
    bot_name: BotName,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> None

Deletes an alias for the specified bot.

You can't delete an alias that is used in the association between a bot and a messaging channel. If an alias is used in a channel association, the DeleteBot operation returns a ResourceInUseException exception that includes a reference to the channel association that refers to the bot. You can remove the reference to the alias by deleting the channel association. If you get the same exception again, delete the referring association until the DeleteBotAlias operation is successful.

Parameters:

  • name (AliasName) –

    The name of the alias to delete. The name is case sensitive.

  • bot_name (BotName) –

    The name of the bot that the alias points to.

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.

  • ConflictException –

    There was a conflict processing the request. Try your request 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.

  • ResourceInUseException –

    The resource that you are attempting to delete is referred to by another resource. Use this information to remove references to the resource that you are trying to delete.

    The body of the exception contains a JSON object that describes the resource.

    { "resourceType": BOT | BOTALIAS | BOTCHANNEL | INTENT,

    "resourceReference": {

    "name": string, "version": string } }

  • 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 delete_bot_alias(
    self,
    name: "capo_lex_model_building_service.types.alias_name.AliasName",
    bot_name: "capo_lex_model_building_service.types.bot_name.BotName",
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> None:
    """<p>Deletes an alias for the specified bot. </p> <p>You can't delete an alias that is used in the association between a bot and a messaging channel. If an alias is used in a channel association, the <code>DeleteBot</code> operation returns a <code>ResourceInUseException</code> exception that includes a reference to the channel association that refers to the bot. You can remove the reference to the alias by deleting the channel association. If you get the same exception again, delete the referring association until the <code>DeleteBotAlias</code> operation is successful.</p>

    Args:
        name: <p>The name of the alias to delete. The name is case sensitive. </p>
        bot_name: <p>The name of the bot that the alias points to.</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.conflict_exception.ConflictException: <p> There was a conflict processing the request. Try your request 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.resource_in_use_exception.ResourceInUseException: <p>The resource that you are attempting to delete is referred to by another resource. Use this information to remove references to the resource that you are trying to delete.</p> <p>The body of the exception contains a JSON object that describes the resource.</p> <p> <code>{ "resourceType": BOT | BOTALIAS | BOTCHANNEL | INTENT,</code> </p> <p> <code>"resourceReference": {</code> </p> <p> <code>"name": <i>string</i>, "version": <i>string</i> } }</code> </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.delete_bot_alias_request.DeleteBotAliasRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_bot_alias

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteBotAlias")
    )
    input_: capo_lex_model_building_service.types.delete_bot_alias_request.DeleteBotAliasRequest = {
        "name": name,
        "bot_name": bot_name,
    }

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