

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# GetComponentType
<a name="API_GetComponentType"></a>

检索有关组件类型的信息。

## 请求语法
<a name="API_GetComponentType_RequestSyntax"></a>

```
GET /workspaces/workspaceId/component-types/componentTypeId HTTP/1.1
```

## URI 请求参数
<a name="API_GetComponentType_RequestParameters"></a>

请求使用以下 URI 参数。

 ** [componentTypeId](#API_GetComponentType_RequestSyntax) **   <a name="tm-GetComponentType-request-uri-componentTypeId"></a>
组件类型的 ID。  
长度限制：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\.\-0-9:]+`  
是否必需：是

 ** [workspaceId](#API_GetComponentType_RequestSyntax) **   <a name="tm-GetComponentType-request-uri-workspaceId"></a>
包含组件类型的工作区 ID。  
长度限制：最小长度为 1。最大长度为 128。  
模式：`[a-zA-Z_0-9][a-zA-Z_\-0-9]*[a-zA-Z0-9]+`  
必需：是

## 请求体
<a name="API_GetComponentType_RequestBody"></a>

该请求没有请求正文。

## 响应语法
<a name="API_GetComponentType_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "arn": "string",
   "componentTypeId": "string",
   "componentTypeName": "string",
   "compositeComponentTypes": { 
      "string" : { 
         "componentTypeId": "string",
         "isInherited": boolean
      }
   },
   "creationDateTime": number,
   "description": "string",
   "extendsFrom": [ "string" ],
   "functions": { 
      "string" : { 
         "implementedBy": { 
            "isNative": boolean,
            "lambda": { 
               "arn": "string"
            }
         },
         "isInherited": boolean,
         "requiredProperties": [ "string" ],
         "scope": "string"
      }
   },
   "isAbstract": boolean,
   "isSchemaInitialized": boolean,
   "isSingleton": boolean,
   "propertyDefinitions": { 
      "string" : { 
         "configuration": { 
            "string" : "string" 
         },
         "dataType": { 
            "allowedValues": [ 
               { 
                  "booleanValue": boolean,
                  "doubleValue": number,
                  "expression": "string",
                  "integerValue": number,
                  "listValue": [ 
                     "DataValue"
                  ],
                  "longValue": number,
                  "mapValue": { 
                     "string" : "DataValue"
                  },
                  "relationshipValue": { 
                     "targetComponentName": "string",
                     "targetEntityId": "string"
                  },
                  "stringValue": "string"
               }
            ],
            "nestedType": "DataType",
            "relationship": { 
               "relationshipType": "string",
               "targetComponentTypeId": "string"
            },
            "type": "string",
            "unitOfMeasure": "string"
         },
         "defaultValue": { 
            "booleanValue": boolean,
            "doubleValue": number,
            "expression": "string",
            "integerValue": number,
            "listValue": [ 
               "DataValue"
            ],
            "longValue": number,
            "mapValue": { 
               "string" : "DataValue"
            },
            "relationshipValue": { 
               "targetComponentName": "string",
               "targetEntityId": "string"
            },
            "stringValue": "string"
         },
         "displayName": "string",
         "isExternalId": boolean,
         "isFinal": boolean,
         "isImported": boolean,
         "isInherited": boolean,
         "isRequiredInEntity": boolean,
         "isStoredExternally": boolean,
         "isTimeSeries": boolean
      }
   },
   "propertyGroups": { 
      "string" : { 
         "groupType": "string",
         "isInherited": boolean,
         "propertyNames": [ "string" ]
      }
   },
   "status": { 
      "error": { 
         "code": "string",
         "message": "string"
      },
      "state": "string"
   },
   "syncSource": "string",
   "updateDateTime": number,
   "workspaceId": "string"
}
```

## 响应元素
<a name="API_GetComponentType_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 ** [arn](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-arn"></a>
组件类型的 ARN。  
类型：字符串  
长度约束：最小长度为 20。最大长度为 2048。  
模式：`arn:((aws)|(aws-cn)|(aws-us-gov)):iottwinmaker:[a-z0-9-]+:[0-9]{12}:[\/a-zA-Z0-9_\-\.:]+`

 ** [componentTypeId](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-componentTypeId"></a>
组件类型的 ID。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\.\-0-9:]+`

 ** [componentTypeName](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-componentTypeName"></a>
组件类型名称。  
类型：字符串  
长度限制：最小长度为 0。最大长度为 256。  
模式：`.*[^\u0000-\u001F\u007F]*.*`

 ** [compositeComponentTypes](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-compositeComponentTypes"></a>
这是一个将字符串映射到 `componentType` 的 `compositeComponentTypes` 的对象。`CompositeComponentType` 由 `componentTypeId` 引用。  
类型：字符串到 [CompositeComponentTypeResponse](API_CompositeComponentTypeResponse.md) 对象的映射  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

 ** [creationDateTime](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-creationDateTime"></a>
创建组件类型的日期和时间。  
类型：时间戳

 ** [description](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-description"></a>
组件类型的描述。  
类型：字符串  
长度约束：最小长度为 0。最大长度为 2048。  
模式：`.*`

 ** [extendsFrom](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-extendsFrom"></a>
此组件类型扩展的父组件类型的名称。  
类型：字符串数组  
长度约束：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\.\-0-9:]+`

 ** [functions](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-functions"></a>
将字符串映射到组件类型中的函数的对象。映射中的每个字符串对于该对象都必须是唯一的。  
类型：字符串到 [FunctionResponse](API_FunctionResponse.md) 对象的映射  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

 ** [isAbstract](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-isAbstract"></a>
指定组件类型是否为抽象的布尔值。  
类型：布尔值

 ** [isSchemaInitialized](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-isSchemaInitialized"></a>
指定组件类型是否具有架构初始化程序以及架构初始化程序是否已运行的布尔值。  
类型：布尔值

 ** [isSingleton](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-isSingleton"></a>
指定一个实体是否可以有多个此类型的组件的布尔值。  
类型：布尔值

 ** [propertyDefinitions](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-propertyDefinitions"></a>
将字符串映射到组件类型中的属性定义的对象。映射中的每个字符串对于该对象都必须是唯一的。  
类型：字符串到 [PropertyDefinitionResponse](API_PropertyDefinitionResponse.md) 对象的映射  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

 ** [propertyGroups](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-propertyGroups"></a>
一次性返回的最大结果数。默认值为 25。  
有效范围：最小值为 1。最大值为 250。  
类型：字符串到 [PropertyGroupResponse](API_PropertyGroupResponse.md) 对象的映射  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

 ** [status](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-status"></a>
组件类型的当前状态。  
类型：[Status](API_Status.md) 对象

 ** [syncSource](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-syncSource"></a>
的 SyncSource SyncJob，前提是该实体是由创建的。 SyncJob  
类型：字符串  
模式：`[a-zA-Z_0-9]+`

 ** [updateDateTime](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-updateDateTime"></a>
上次更新组件的日期和时间。  
类型：时间戳

 ** [workspaceId](#API_GetComponentType_ResponseSyntax) **   <a name="tm-GetComponentType-response-workspaceId"></a>
包含组件类型的工作区 ID。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 128。  
模式：`[a-zA-Z_0-9][a-zA-Z_\-0-9]*[a-zA-Z0-9]+`

## 错误
<a name="API_GetComponentType_Errors"></a>

有关所有操作的常见错误的信息，请参阅[常见错误](CommonErrors.md)。

 ** AccessDeniedException **   
访问被拒绝。  
HTTP 状态代码：403

 ** InternalServerException **   
出现意外错误。  
HTTP 状态代码：500

 ** ResourceNotFoundException **   
未找到资源。  
HTTP 状态代码：404

 ** ThrottlingException **   
速率超过限制。  
HTTP 状态代码：429

 ** ValidationException **   
失败  
HTTP 状态代码：400

## 另请参阅
<a name="API_GetComponentType_SeeAlso"></a>

有关以特定语言之一使用此 API 的更多信息 AWS SDKs，请参阅以下内容：
+  [AWS 命令行界面 V2](https://docs.aws.amazon.com/goto/cli2/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于.NET 的 SDK V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 Go v2 的 SDK](https://docs.aws.amazon.com/goto/SdkForGoV2/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 Java 的 SDK V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS JavaScript V3 版软件开发工具包](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 PHP 的 SDK V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS Python 软件开发工具包](https://docs.aws.amazon.com/goto/boto3/iottwinmaker-2021-11-29/GetComponentType) 
+  [AWS 适用于 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/iottwinmaker-2021-11-29/GetComponentType) 