:doc:`IoTTwinMaker <../../iottwinmaker>` / Client / create_component_type

*********************
create_component_type
*********************



.. py:method:: IoTTwinMaker.Client.create_component_type(**kwargs)

  

  Creates a component type.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iottwinmaker-2021-11-29/CreateComponentType>`_  


  **Request Syntax**
  ::

    response = client.create_component_type(
        workspaceId='string',
        isSingleton=True|False,
        componentTypeId='string',
        description='string',
        propertyDefinitions={
            'string': {
                'dataType': {
                    'type': 'RELATIONSHIP'|'STRING'|'LONG'|'BOOLEAN'|'INTEGER'|'DOUBLE'|'LIST'|'MAP',
                    'nestedType': {'... recursive ...'},
                    'allowedValues': [
                        {
                            'booleanValue': True|False,
                            'doubleValue': 123.0,
                            'integerValue': 123,
                            'longValue': 123,
                            'stringValue': 'string',
                            'listValue': {'... recursive ...'},
                            'mapValue': {
                                'string': {'... recursive ...'}
                            },
                            'relationshipValue': {
                                'targetEntityId': 'string',
                                'targetComponentName': 'string'
                            },
                            'expression': 'string'
                        },
                    ],
                    'unitOfMeasure': 'string',
                    'relationship': {
                        'targetComponentTypeId': 'string',
                        'relationshipType': 'string'
                    }
                },
                'isRequiredInEntity': True|False,
                'isExternalId': True|False,
                'isStoredExternally': True|False,
                'isTimeSeries': True|False,
                'defaultValue': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'integerValue': 123,
                    'longValue': 123,
                    'stringValue': 'string',
                    'listValue': [
                        {'... recursive ...'},
                    ],
                    'mapValue': {
                        'string': {'... recursive ...'}
                    },
                    'relationshipValue': {
                        'targetEntityId': 'string',
                        'targetComponentName': 'string'
                    },
                    'expression': 'string'
                },
                'configuration': {
                    'string': 'string'
                },
                'displayName': 'string'
            }
        },
        extendsFrom=[
            'string',
        ],
        functions={
            'string': {
                'requiredProperties': [
                    'string',
                ],
                'scope': 'ENTITY'|'WORKSPACE',
                'implementedBy': {
                    'lambda': {
                        'arn': 'string'
                    },
                    'isNative': True|False
                }
            }
        },
        tags={
            'string': 'string'
        },
        propertyGroups={
            'string': {
                'groupType': 'TABULAR',
                'propertyNames': [
                    'string',
                ]
            }
        },
        componentTypeName='string',
        compositeComponentTypes={
            'string': {
                'componentTypeId': 'string'
            }
        }
    )
    
  :type workspaceId: string
  :param workspaceId: **[REQUIRED]** 

    The ID of the workspace that contains the component type.

    

  
  :type isSingleton: boolean
  :param isSingleton: 

    A Boolean value that specifies whether an entity can have more than one component of this type.

    

  
  :type componentTypeId: string
  :param componentTypeId: **[REQUIRED]** 

    The ID of the component type.

    

  
  :type description: string
  :param description: 

    The description of the component type.

    

  
  :type propertyDefinitions: dict
  :param propertyDefinitions: 

    An object that maps strings to the property definitions in the component type. Each string in the mapping must be unique to this object.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        An object that sets information about a property.

        

      
        - **dataType** *(dict) --* 

          An object that contains information about the data type.

          

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

            The underlying type of the data type.

            

          
          - **nestedType** *(dict) --* 

            The nested type in the data type.

            

          
          - **allowedValues** *(list) --* 

            The allowed values for this data type.

            

          
            - *(dict) --* 

              An object that specifies a value for a property.

              

            
              - **booleanValue** *(boolean) --* 

                A Boolean value.

                

              
              - **doubleValue** *(float) --* 

                A double value.

                

              
              - **integerValue** *(integer) --* 

                An integer value.

                

              
              - **longValue** *(integer) --* 

                A long value.

                

              
              - **stringValue** *(string) --* 

                A string value.

                

              
              - **listValue** *(list) --* 

                A list of multiple values.

                

              
              - **mapValue** *(dict) --* 

                An object that maps strings to multiple ``DataValue`` objects.

                

              
                - *(string) --* 

                
                  - *(dict) --* 

                    An object that specifies a value for a property.

                    

                  
            
          
              - **relationshipValue** *(dict) --* 

                A value that relates a component to another component.

                

              
                - **targetEntityId** *(string) --* 

                  The ID of the target entity associated with this relationship value.

                  

                
                - **targetComponentName** *(string) --* 

                  The name of the target component associated with the relationship value.

                  

                
              
              - **expression** *(string) --* 

                An expression that produces the value.

                

              
            
        
          - **unitOfMeasure** *(string) --* 

            The unit of measure used in this data type.

            

          
          - **relationship** *(dict) --* 

            A relationship that associates a component with another component.

            

          
            - **targetComponentTypeId** *(string) --* 

              The ID of the target component type associated with this relationship.

              

            
            - **relationshipType** *(string) --* 

              The type of the relationship.

              

            
          
        
        - **isRequiredInEntity** *(boolean) --* 

          A Boolean value that specifies whether the property is required.

          

        
        - **isExternalId** *(boolean) --* 

          A Boolean value that specifies whether the property ID comes from an external data store.

          

        
        - **isStoredExternally** *(boolean) --* 

          A Boolean value that specifies whether the property is stored externally.

          

        
        - **isTimeSeries** *(boolean) --* 

          A Boolean value that specifies whether the property consists of time series data.

          

        
        - **defaultValue** *(dict) --* 

          An object that contains the default value.

          

        
          - **booleanValue** *(boolean) --* 

            A Boolean value.

            

          
          - **doubleValue** *(float) --* 

            A double value.

            

          
          - **integerValue** *(integer) --* 

            An integer value.

            

          
          - **longValue** *(integer) --* 

            A long value.

            

          
          - **stringValue** *(string) --* 

            A string value.

            

          
          - **listValue** *(list) --* 

            A list of multiple values.

            

          
            - *(dict) --* 

              An object that specifies a value for a property.

              

            
        
          - **mapValue** *(dict) --* 

            An object that maps strings to multiple ``DataValue`` objects.

            

          
            - *(string) --* 

            
              - *(dict) --* 

                An object that specifies a value for a property.

                

              
        
      
          - **relationshipValue** *(dict) --* 

            A value that relates a component to another component.

            

          
            - **targetEntityId** *(string) --* 

              The ID of the target entity associated with this relationship value.

              

            
            - **targetComponentName** *(string) --* 

              The name of the target component associated with the relationship value.

              

            
          
          - **expression** *(string) --* 

            An expression that produces the value.

            

          
        
        - **configuration** *(dict) --* 

          A mapping that specifies configuration information about the property. Use this field to specify information that you read from and write to an external source.

          

        
          - *(string) --* 

          
            - *(string) --* 

            
      
    
        - **displayName** *(string) --* 

          A friendly name for the property.

          

        
      


  :type extendsFrom: list
  :param extendsFrom: 

    Specifies the parent component type to extend.

    

  
    - *(string) --* 

    

  :type functions: dict
  :param functions: 

    An object that maps strings to the functions in the component type. Each string in the mapping must be unique to this object.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        The function request body.

        

      
        - **requiredProperties** *(list) --* 

          The required properties of the function.

          

        
          - *(string) --* 

          
      
        - **scope** *(string) --* 

          The scope of the function.

          

        
        - **implementedBy** *(dict) --* 

          The data connector.

          

        
          - **lambda** *(dict) --* 

            The Lambda function associated with this data connector.

            

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

              The ARN of the Lambda function.

              

            
          
          - **isNative** *(boolean) --* 

            A Boolean value that specifies whether the data connector is native to IoT TwinMaker.

            

          
        
      


  :type tags: dict
  :param tags: 

    Metadata that you can use to manage the component type.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type propertyGroups: dict
  :param propertyGroups: 

  
    - *(string) --* 

    
      - *(dict) --* 

      
        - **groupType** *(string) --* 

          The group type.

          

        
        - **propertyNames** *(list) --* 

          The names of properties.

          

        
          - *(string) --* 

          
      
      


  :type componentTypeName: string
  :param componentTypeName: 

    A friendly name for the component type.

    

  
  :type compositeComponentTypes: dict
  :param compositeComponentTypes: 

    This is an object that maps strings to ``compositeComponentTypes`` of the ``componentType``. ``CompositeComponentType`` is referenced by ``componentTypeId``.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        An object that sets information about the composite component types of a component type.

        

      
        - **componentTypeId** *(string) --* 

          This is the ``componentTypeId`` that the ``compositeComponentType`` refers to.

          

        
      


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

    
    ::

      {
          'arn': 'string',
          'creationDateTime': datetime(2015, 1, 1),
          'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'ERROR'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **arn** *(string) --* 

        The ARN of the component type.

        
      

      - **creationDateTime** *(datetime) --* 

        The date and time when the entity was created.

        
      

      - **state** *(string) --* 

        The current state of the component type.

        
  
  **Exceptions**
  
  *   :py:class:`IoTTwinMaker.Client.exceptions.InternalServerException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ValidationException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ConflictException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ServiceQuotaExceededException`

  