LexModelBuildingService / Client / get_intents

get_intents#

LexModelBuildingService.Client.get_intents(**kwargs)#

Returns intent information as follows:

  • If you specify the nameContains field, returns the $LATEST version of all intents that contain the specified string.

  • If you don’t specify the nameContains field, returns information about the $LATEST version of all intents.

The operation requires permission for the lex:GetIntents action.

See also: AWS API Documentation

Request Syntax

response = client.get_intents(
    nextToken='string',
    maxResults=123,
    nameContains='string'
)
Parameters:
  • nextToken (string) – A pagination token that fetches the next page of intents. If the response to this API call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of intents, specify the pagination token in the next request.

  • maxResults (integer) – The maximum number of intents to return in the response. The default is 10.

  • nameContains (string) – Substring to match in intent names. An intent 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

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

Response Structure

  • (dict) –

    • intents (list) –

      An array of Intent objects. For more information, see PutBot.

      • (dict) –

        Provides information about an intent.

        • name (string) –

          The name of the intent.

        • description (string) –

          A description of the intent.

        • lastUpdatedDate (datetime) –

          The date that the intent was updated. When you create an intent, the creation date and last updated date are the same.

        • createdDate (datetime) –

          The date that the intent was created.

        • version (string) –

          The version of the intent.

    • nextToken (string) –

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

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 intents in your account.

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

print(response)

Expected Output:

{
    'intents': [
        {
            'version': '$LATEST',
            'name': 'DocOrderPizza',
            'createdDate': 1494359783.453,
            'description': 'Order a pizza from a local pizzeria.',
            'lastUpdatedDate': 1494359783.453,
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}