Deletes a specific version of a slot type. To delete all versions of a slot type, use the DeleteSlotType operation.
This operation requires permissions for the lex:DeleteSlotTypeVersion action.
Parameters:
-
name
(SlotTypeName)
–
The name of the slot type.
-
version
(NumericalVersion)
–
The version of the slot type to delete. You cannot delete the $LATEST version of the slot type. To delete the $LATEST version, use the DeleteSlotType 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/async_lex_model_building_service.py
| async def delete_slot_type_version(
self,
name: "capo_lex_model_building_service.types.slot_type_name.SlotTypeName",
version: "capo_lex_model_building_service.types.numerical_version.NumericalVersion",
*,
config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> None:
"""<p>Deletes a specific version of a slot type. To delete all versions of a slot type, use the <a>DeleteSlotType</a> operation. </p> <p>This operation requires permissions for the <code>lex:DeleteSlotTypeVersion</code> action.</p>
Args:
name: <p>The name of the slot type.</p>
version: <p>The version of the slot type to delete. You cannot delete the <code>$LATEST</code> version of the slot type. To delete the <code>$LATEST</code> version, use the <a>DeleteSlotType</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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_lex_model_building_service.types.delete_slot_type_version_request.DeleteSlotTypeVersionRequest]",
) -> AsyncOperationResponse[None]:
import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_slot_type_version
(
output,
http_response,
) = await capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_slot_type_version.async_delete_slot_type_version(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSlotTypeVersion")
)
input_: capo_lex_model_building_service.types.delete_slot_type_version_request.DeleteSlotTypeVersionRequest = {
"name": name,
"version": version,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|