:doc:`IoT <../../iot>` / Client / list_thing_groups

*****************
list_thing_groups
*****************



.. py:method:: IoT.Client.list_thing_groups(**kwargs)

  

  List the thing groups in your account.

   

  Requires permission to access the `ListThingGroups <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingGroups>`_  


  **Request Syntax**
  ::

    response = client.list_thing_groups(
        nextToken='string',
        maxResults=123,
        parentGroup='string',
        namePrefixFilter='string',
        recursive=True|False
    )
    
  :type nextToken: string
  :param nextToken: 

    To retrieve the next set of results, the ``nextToken`` value from a previous response; otherwise **null** to receive the first set of results.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return at one time.

    

  
  :type parentGroup: string
  :param parentGroup: 

    A filter that limits the results to those with the specified parent group.

    

  
  :type namePrefixFilter: string
  :param namePrefixFilter: 

    A filter that limits the results to those with the specified name prefix.

    

  
  :type recursive: boolean
  :param recursive: 

    If true, return child groups as well.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'thingGroups': [
              {
                  'groupName': 'string',
                  'groupArn': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **thingGroups** *(list) --* 

        The thing groups.

        
        

        - *(dict) --* 

          The name and ARN of a group.

          
          

          - **groupName** *(string) --* 

            The group name.

            
          

          - **groupArn** *(string) --* 

            The group ARN.

            
      
    
      

      - **nextToken** *(string) --* 

        The token to use to get the next set of results. Will not be returned if operation has returned all results.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  