:doc:`LexModelBuildingService <../../lex-models>` / Client / get_intents

***********
get_intents
***********



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntents>`_  


  **Request Syntax**
  ::

    response = client.get_intents(
        nextToken='string',
        maxResults=123,
        nameContains='string'
    )
    
  :type nextToken: string
  :param nextToken: 

    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.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of intents to return in the response. The default is 10.

    

  
  :type nameContains: string
  :param nameContains: 

    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."

    

  
  
  :rtype: 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**
  
  *   :py:class:`LexModelBuildingService.Client.exceptions.NotFoundException`

  
  *   :py:class:`LexModelBuildingService.Client.exceptions.LimitExceededException`

  
  *   :py:class:`LexModelBuildingService.Client.exceptions.InternalFailureException`

  
  *   :py:class:`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': {
            '...': '...',
        },
    }

  