{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aqara/json-schema/aqara-create-automation-request-schema.json",
  "title": "CreateAutomationRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/data-export-api-zh.yaml#/components/schemas/CreateAutomationRequest",
  "type": "object",
  "required": [
    "definitionType",
    "config"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "自动化名称"
    },
    "autoSuffixOnDuplicate": {
      "type": "boolean",
      "default": true,
      "description": "名称重名处理策略。未传或为 true 时自动添加 (1)、(2) 等后缀；为 false 时返回名称重复错误"
    },
    "definitionType": {
      "$ref": "#/$defs/AutomationDefinitionType"
    },
    "config": {
      "type": "object",
      "description": "JSON 自动化脚本，详情请参考 [JSON 自动化脚本定义](https://docs.aqara.com/zh/docs/aqara-developer/data-export-api/reference/json-automation-script)。",
      "additionalProperties": true
    }
  },
  "$defs": {
    "AutomationDefinitionType": {
      "type": "string",
      "enum": [
        "SCRIPT_JSON"
      ],
      "description": "自动化定义类型，当前仅支持 SCRIPT_JSON"
    }
  }
}