slot_types
Creates, updates, deletes, gets or lists a slot_types resource.
Overview
| Name | slot_types |
| Type | Resource |
| Id | aws.lex_models.slot_types |
Fields
The following fields are returned by SELECT queries:
- get_slot_type
- get_slot_types
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the slot type. (pattern: <code>^([A-Za-z]_?)+$</code>) |
checksum | string | Checksum of the $LATEST version of the slot type. |
created_date | string (date-time) | The date that the slot type was created. |
description | string | A description of the slot type. |
enumeration_values | array | A list of EnumerationValue objects that defines the values that the slot type can take. |
last_updated_date | string (date-time) | The date that the slot type was updated. When you create a resource, the creation date and last update date are the same. |
parent_slot_type_signature | string | The built-in slot type used as a parent for the slot type. (pattern: <code>^((AMAZON.)?|[A-Za-z]?)+</code>) |
slot_type_configurations | array | Configuration information that extends the parent built-in slot type. |
value_selection_strategy | string | The strategy that Amazon Lex uses to determine the value of the slot. For more information, see PutSlotType. (ORIGINAL_VALUE, TOP_RESOLUTION) |
version | string | The version of the slot type. (pattern: <code>$LATEST|[0-9]+</code>) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the slot type. (pattern: <code>^([A-Za-z]_?)+$</code>) |
created_date | string (date-time) | The date that the slot type was created. |
description | string | A description of the slot type. |
last_updated_date | string (date-time) | The date that the slot type was updated. When you create a resource, the creation date and last updated date are the same. |
version | string | The version of the slot type. (pattern: <code>$LATEST|[0-9]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_slot_type | select | name, version, region | Returns information about a specific version of a slot type. In addition to specifying the slot type name, you must specify the slot type version. This operation requires permissions for the lex:GetSlotType action. | |
get_slot_types | select | region | nextToken, maxResults, nameContains | Returns slot type information as follows: If you specify the nameContains field, returns the $LATEST version of all slot types that contain the specified string. If you don't specify the nameContains field, returns information about the $LATEST version of all slot types. The operation requires permission for the lex:GetSlotTypes action. |
put_slot_type | replace | name, region | Creates a custom slot type or replaces an existing custom slot type. To create a custom slot type, specify a name for the slot type and a set of enumeration values, which are the values that a slot of this type can assume. For more information, see how-it-works. If you specify the name of an existing slot type, the fields in the request replace the existing values in the $LATEST version of the slot type. Amazon Lex removes the fields that you don't provide in the request. If you don't specify required fields, Amazon Lex throws an exception. When you update the $LATEST version of a slot type, if a bot uses the $LATEST version of an intent that contains the slot type, the bot's status field is set to NOT_BUILT. This operation requires permissions for the lex:PutSlotType action. | |
delete_slot_type | delete | name, region | Deletes all versions of the slot type, including the $LATEST version. To delete a specific version of the slot type, use the DeleteSlotTypeVersion operation. You can delete a version of a slot type only if it is not referenced. To delete a slot type that is referred to in one or more intents, you must remove those references first. If you get the ResourceInUseException exception, the exception provides an example reference that shows the intent where the slot type is referenced. To remove the reference to the slot type, either update the intent or delete it. If you get the same exception when you attempt to delete the slot type again, repeat until the slot type has no references and the DeleteSlotType call is successful. This operation requires permission for the lex:DeleteSlotType action. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the slot type. The name is case sensitive. |
region | string | AWS region (default: us-east-1) |
version | string | The version of the slot type. |
maxResults | integer | The maximum number of slot types to return in the response. The default is 10. |
nameContains | string | Substring to match in slot type names. A slot type will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz." |
nextToken | string | A pagination token that fetches the next page of slot types. If the response to this API call is truncated, Amazon Lex returns a pagination token in the response. To fetch next page of slot types, specify the pagination token in the next request. |
SELECT examples
- get_slot_type
- get_slot_types
Returns information about a specific version of a slot type. In addition to specifying the slot type name, you must specify the slot type version. This operation requires permissions for the lex:GetSlotType action.
SELECT
name,
checksum,
created_date,
description,
enumeration_values,
last_updated_date,
parent_slot_type_signature,
slot_type_configurations,
value_selection_strategy,
version
FROM aws.lex_models.slot_types
WHERE name = '{{ name }}' -- required
AND version = '{{ version }}' -- required
AND region = '{{ region }}' -- required
;
Returns slot type information as follows: If you specify the nameContains field, returns the $LATEST version of all slot types that contain the specified string. If you don't specify the nameContains field, returns information about the $LATEST version of all slot types. The operation requires permission for the lex:GetSlotTypes action.
SELECT
name,
created_date,
description,
last_updated_date,
version
FROM aws.lex_models.slot_types
WHERE region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND nameContains = '{{ nameContains }}'
;
REPLACE examples
- put_slot_type
Creates a custom slot type or replaces an existing custom slot type. To create a custom slot type, specify a name for the slot type and a set of enumeration values, which are the values that a slot of this type can assume. For more information, see how-it-works. If you specify the name of an existing slot type, the fields in the request replace the existing values in the $LATEST version of the slot type. Amazon Lex removes the fields that you don't provide in the request. If you don't specify required fields, Amazon Lex throws an exception. When you update the $LATEST version of a slot type, if a bot uses the $LATEST version of an intent that contains the slot type, the bot's status field is set to NOT_BUILT. This operation requires permissions for the lex:PutSlotType action.
REPLACE aws.lex_models.slot_types
SET
description = '{{ description }}',
enumerationValues = '{{ enumerationValues }}',
checksum = '{{ checksum }}',
valueSelectionStrategy = '{{ valueSelectionStrategy }}',
createVersion = {{ createVersion }},
parentSlotTypeSignature = '{{ parentSlotTypeSignature }}',
slotTypeConfigurations = '{{ slotTypeConfigurations }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
RETURNING
name,
checksum,
create_version,
created_date,
description,
enumeration_values,
last_updated_date,
parent_slot_type_signature,
slot_type_configurations,
value_selection_strategy,
version;
DELETE examples
- delete_slot_type
Deletes all versions of the slot type, including the $LATEST version. To delete a specific version of the slot type, use the DeleteSlotTypeVersion operation. You can delete a version of a slot type only if it is not referenced. To delete a slot type that is referred to in one or more intents, you must remove those references first. If you get the ResourceInUseException exception, the exception provides an example reference that shows the intent where the slot type is referenced. To remove the reference to the slot type, either update the intent or delete it. If you get the same exception when you attempt to delete the slot type again, repeat until the slot type has no references and the DeleteSlotType call is successful. This operation requires permission for the lex:DeleteSlotType action.
DELETE FROM aws.lex_models.slot_types
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
;