get_slot_types

LexModelBuildingService.Client.get_slot_types(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.get_slot_types(
    nextToken='string',
    maxResults=123,
    nameContains='string'
)
Parameters
  • 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.
  • 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."
Return type

dict

Returns

Response Syntax

{
    'slotTypes': [
        {
            'name': 'string',
            'description': 'string',
            'lastUpdatedDate': datetime(2015, 1, 1),
            'createdDate': datetime(2015, 1, 1),
            'version': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • slotTypes (list) --

      An array of objects, one for each slot type, that provides information such as the name of the slot type, the version, and a description.

      • (dict) --

        Provides information about a slot type..

        • name (string) --

          The name of the slot type.

        • description (string) --

          A description of the slot type.

        • lastUpdatedDate (datetime) --

          The date that the slot type was updated. When you create a resource, the creation date and last updated date are the same.

        • createdDate (datetime) --

          The date that the slot type was created.

        • version (string) --

          The version of the slot type.

    • nextToken (string) --

      If the response is truncated, it includes a pagination token that you can specify in your next request to fetch the next page of slot types.

Exceptions

  • LexModelBuildingService.Client.exceptions.NotFoundException
  • LexModelBuildingService.Client.exceptions.LimitExceededException
  • LexModelBuildingService.Client.exceptions.InternalFailureException
  • LexModelBuildingService.Client.exceptions.BadRequestException

Examples

This example shows how to get a list of all of the slot types in your account.

response = client.get_slot_types(
    maxResults=10,
    nextToken='',
)

print(response)

Expected Output:

{
    'slotTypes': [
        {
            'version': '$LATEST',
            'name': 'DocPizzaCrustType',
            'createdDate': 1494359274.403,
            'description': 'Available crust types',
            'lastUpdatedDate': 1494359274.403,
        },
        {
            'version': '$LATEST',
            'name': 'DocPizzaSauceType',
            'createdDate': 1494356442.23,
            'description': 'Available pizza sauces',
            'lastUpdatedDate': 1494356442.23,
        },
        {
            'version': '$LATEST',
            'name': 'DocPizzaType',
            'createdDate': 1494359198.656,
            'description': 'Available pizzas',
            'lastUpdatedDate': 1494359198.656,
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}