Deletes a specific version of a bot. To delete all versions of a bot, use the DeleteBot operation.
This operation requires permissions for the lex:DeleteBotVersion action.
Parameters:
-
name
(BotName)
–
-
version
(NumericalVersion)
–
The version of the bot to delete. You cannot delete the $LATEST version of the bot. To delete the $LATEST version, use the DeleteBot operation.
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/lex_model_building_service.py
| def delete_bot_version(
self,
name: "capo_lex_model_building_service.types.bot_name.BotName",
version: "capo_lex_model_building_service.types.numerical_version.NumericalVersion",
*,
config_overrides: Optional[LexModelBuildingServiceClientConfig] = None,
) -> None:
"""<p>Deletes a specific version of a bot. To delete all versions of a bot, use the <a>DeleteBot</a> operation. </p> <p>This operation requires permissions for the <code>lex:DeleteBotVersion</code> action.</p>
Args:
name: <p>The name of the bot.</p>
version: <p>The version of the bot to delete. You cannot delete the <code>$LATEST</code> version of the bot. To delete the <code>$LATEST</code> version, use the <a>DeleteBot</a> operation.</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.
"""
def _handler(
req: "OperationRequest[capo_lex_model_building_service.types.delete_bot_version_request.DeleteBotVersionRequest]",
) -> OperationResponse[None]:
import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_bot_version
output, http_response = (
capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_bot_version.delete_bot_version(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteBotVersion")
)
input_: capo_lex_model_building_service.types.delete_bot_version_request.DeleteBotVersionRequest = {
"name": name,
"version": version,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|