{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aqara/json-schema/aqara-trait-execute-response-schema.json",
  "title": "TraitExecuteResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiot-api-zh.yaml#/components/schemas/TraitExecuteResponse",
  "allOf": [
    {
      "$ref": "#/$defs/BaseResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "description": "data 集合元素为执行失败的 trait 数据。",
          "items": {
            "$ref": "#/$defs/TraitExecuteResult"
          }
        }
      }
    }
  ],
  "$defs": {
    "BaseResponse": {
      "type": "object",
      "required": [
        "type",
        "version",
        "msgId",
        "code"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "消息类型。"
        },
        "version": {
          "type": "string",
          "description": "接口版本。"
        },
        "msgId": {
          "type": "string",
          "description": "消息 ID。"
        },
        "code": {
          "type": "integer",
          "description": "业务状态码，0 表示成功。"
        },
        "message": {
          "type": "string",
          "description": "提示信息。"
        }
      }
    },
    "TraitExecuteResult": {
      "type": "object",
      "required": [
        "deviceId",
        "endpointId",
        "functionCode",
        "traitCode",
        "code",
        "message"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "description": "设备 ID。"
        },
        "endpointId": {
          "type": "integer",
          "description": "端点 ID。"
        },
        "functionCode": {
          "type": "string",
          "description": "功能编码。"
        },
        "traitCode": {
          "type": "string",
          "description": "功能点代码。"
        },
        "code": {
          "type": "integer",
          "description": "错误码。"
        },
        "message": {
          "type": "string",
          "description": "错误信息。"
        }
      }
    }
  }
}