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

*****************
create_thing_type
*****************



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

  

  Creates a new thing type. If this call is made multiple times using the same thing type name and configuration, the call will succeed. If this call is made with the same thing type name but different configuration a ``ResourceAlreadyExistsException`` is thrown.

   

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


  **Request Syntax**
  ::

    response = client.create_thing_type(
        thingTypeName='string',
        thingTypeProperties={
            'thingTypeDescription': 'string',
            'searchableAttributes': [
                'string',
            ],
            'mqtt5Configuration': {
                'propagatingAttributes': [
                    {
                        'userPropertyKey': 'string',
                        'thingAttribute': 'string',
                        'connectionAttribute': 'string'
                    },
                ]
            }
        },
        tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type thingTypeName: string
  :param thingTypeName: **[REQUIRED]** 

    The name of the thing type.

    

  
  :type thingTypeProperties: dict
  :param thingTypeProperties: 

    The ThingTypeProperties for the thing type to create. It contains information about the new thing type including a description, and a list of searchable thing attribute names.

    

  
    - **thingTypeDescription** *(string) --* 

      The description of the thing type.

      

    
    - **searchableAttributes** *(list) --* 

      A list of searchable thing attribute names.

      

    
      - *(string) --* 

      
  
    - **mqtt5Configuration** *(dict) --* 

      The configuration to add user-defined properties to enrich MQTT 5 messages.

      

    
      - **propagatingAttributes** *(list) --* 

        An object that represents the propagating thing attributes and the connection attributes.

        

      
        - *(dict) --* 

          An object that represents the connection attribute, thing attribute, and the user property key.

          

        
          - **userPropertyKey** *(string) --* 

            The key of the user property key-value pair.

            

          
          - **thingAttribute** *(string) --* 

            The user-defined thing attribute that is propagating for MQTT 5 message enrichment.

            

          
          - **connectionAttribute** *(string) --* 

            The attribute associated with the connection between a device and Amazon Web Services IoT Core.

            

          
        
    
    
  
  :type tags: list
  :param tags: 

    Metadata which can be used to manage the thing type.

    

  
    - *(dict) --* 

      A set of key/value pairs that are used to manage the resource.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The tag's key.

        

      
      - **Value** *(string) --* 

        The tag's value.

        

      
    

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

    
    ::

      {
          'thingTypeName': 'string',
          'thingTypeArn': 'string',
          'thingTypeId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output of the CreateThingType operation.

      
      

      - **thingTypeName** *(string) --* 

        The name of the thing type.

        
      

      - **thingTypeArn** *(string) --* 

        The Amazon Resource Name (ARN) of the thing type.

        
      

      - **thingTypeId** *(string) --* 

        The thing type ID.

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

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

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

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

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

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

  