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

*****************************
update_thing_groups_for_thing
*****************************



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

  

  Updates the groups to which the thing belongs.

   

  Requires permission to access the `UpdateThingGroupsForThing <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/UpdateThingGroupsForThing>`_  


  **Request Syntax**
  ::

    response = client.update_thing_groups_for_thing(
        thingName='string',
        thingGroupsToAdd=[
            'string',
        ],
        thingGroupsToRemove=[
            'string',
        ],
        overrideDynamicGroups=True|False
    )
    
  :type thingName: string
  :param thingName: 

    The thing whose group memberships will be updated.

    

  
  :type thingGroupsToAdd: list
  :param thingGroupsToAdd: 

    The groups to which the thing will be added.

    

  
    - *(string) --* 

    

  :type thingGroupsToRemove: list
  :param thingGroupsToRemove: 

    The groups from which the thing will be removed.

    

  
    - *(string) --* 

    

  :type overrideDynamicGroups: boolean
  :param overrideDynamicGroups: 

    Override dynamic thing groups with static thing groups when 10-group limit is reached. If a thing belongs to 10 thing groups, and one or more of those groups are dynamic thing groups, adding a thing to a static group removes the thing from the last dynamic group.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

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

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

  