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

********
get_bots
********



.. py:method:: LexModelBuildingService.Client.get_bots(**kwargs)

  

  Returns bot information as follows:

   

  
  * If you provide the ``nameContains`` field, the response includes information for the ``$LATEST`` version of all bots whose name contains the specified string.
   
  * If you don't specify the ``nameContains`` field, the operation returns information about the ``$LATEST`` version of all of your bots.
  

   

  This operation requires permission for the ``lex:GetBots`` action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBots>`_  


  **Request Syntax**
  ::

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

    A pagination token that fetches the next page of bots. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of bots, specify the pagination token in the next request.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of bots to return in the response that the request will return. The default is 10.

    

  
  :type nameContains: string
  :param nameContains: 

    Substring to match in bot names. A bot 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**

    
    ::

      {
          'bots': [
              {
                  'name': 'string',
                  'description': 'string',
                  'status': 'BUILDING'|'READY'|'READY_BASIC_TESTING'|'FAILED'|'NOT_BUILT',
                  'lastUpdatedDate': datetime(2015, 1, 1),
                  'createdDate': datetime(2015, 1, 1),
                  'version': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **bots** *(list) --* 

        An array of ``botMetadata`` objects, with one entry for each bot.

        
        

        - *(dict) --* 

          Provides information about a bot. .

          
          

          - **name** *(string) --* 

            The name of the bot.

            
          

          - **description** *(string) --* 

            A description of the bot.

            
          

          - **status** *(string) --* 

            The status of the bot.

            
          

          - **lastUpdatedDate** *(datetime) --* 

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

            
          

          - **createdDate** *(datetime) --* 

            The date that the bot was created.

            
          

          - **version** *(string) --* 

            The version of the bot. For a new bot, the version is always ``$LATEST``.

            
      
    
      

      - **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 bots.

        
  
  **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 bots in your account.
  ::

    response = client.get_bots(
        maxResults=5,
        nextToken='',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'bots': [
            {
                'version': '$LATEST',
                'name': 'DocOrderPizzaBot',
                'createdDate': 1494360160.133,
                'description': 'Orders a pizza from a local pizzeria.',
                'lastUpdatedDate': 1494360160.133,
                'status': 'NOT_BUILT',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  