{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aqara/json-schema/aqara-update-automation-request-schema.json",
  "title": "UpdateAutomationRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/data-export-api-zh.yaml#/components/schemas/UpdateAutomationRequest",
  "type": "object",
  "required": [
    "updateMask"
  ],
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "新名称。"
    },
    "autoSuffixOnDuplicate": {
      "type": "boolean",
      "default": true,
      "description": "名称重名处理策略。未传或为 true 时自动添加 (1)、(2) 等后缀；为 false 时返回名称重复错误。该字段不需要加入 updateMask。"
    },
    "enabled": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "新启用状态。true：启用；false：禁用。"
    },
    "config": {
      "type": [
        "object",
        "null"
      ],
      "description": "新配置。仅适用于 definitionType 为 SCRIPT_JSON 的自动化，其他类型自动化的配置不可编辑。",
      "additionalProperties": true
    },
    "updateMask": {
      "type": "array",
      "description": "需更新的参数名称列表，仅支持 name、enabled、config。   \n**注意**：name 和 enabled 适用于所有自动化。config 只适用于 definitionType 为 SCRIPT_JSON 的自动化。 \n",
      "items": {
        "type": "string",
        "enum": [
          "name",
          "enabled",
          "config"
        ]
      }
    }
  }
}