{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-calendar-event-patch-schema.json",
  "title": "CalendarEventPatch",
  "description": "Отсутствующий ключ и null означают «не менять»; participants при наличии заменяет список целиком.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-calendar-api-openapi.yml#/components/schemas/CalendarEventPatch",
  "type": "object",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "owner": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "location": {
      "type": [
        "string",
        "null"
      ]
    },
    "starts_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "ends_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "timezone": {
      "type": [
        "string",
        "null"
      ]
    },
    "all_day": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "important": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "visibility": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "private",
        "public",
        null
      ]
    },
    "busy_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "busy",
        "free",
        null
      ]
    },
    "recurrence_freq": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "none",
        "daily",
        "weekly",
        "monthly",
        "yearly",
        null
      ]
    },
    "recurrence_interval": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "recurrence_days": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 6
      }
    },
    "recurrence_month_day": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 31
    },
    "recurrence_until": {
      "type": [
        "string",
        "null"
      ]
    },
    "recurrence_count": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "confirmed",
        "cancelled",
        "tentative",
        null
      ]
    },
    "participants": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CalendarParticipantInput"
      }
    },
    "payload": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "export_target": {
      "type": [
        "string",
        "null"
      ],
      "description": "local либо `<UUID подключения>/<календарь>`: календарь — его адрес (url) или id из selected_calendars подключения (GET /api/v1/calendar/connectors), можно с кодированием, как в форме, или коротким последним сегментом адреса (UUID коллекции iCloud). Сервер хранит каноничную запись формы. Подключение должно выгружать события (direction both или export), календарь — быть включён и доступен для записи; иначе 400 calendar.export_target_unavailable, нераспознанная запись — 400 calendar.export_target_format."
    },
    "calendar_source": {
      "type": [
        "string",
        "null"
      ]
    },
    "conference_url": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2048,
      "description": "Пустая строка убирает видеовстречу. Новая ссылка без conference_provider считается вставленной вручную (link)."
    },
    "conference_provider": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "",
        "telemost",
        "personal",
        "link",
        null
      ]
    },
    "conference_id": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    }
  },
  "$defs": {
    "CalendarParticipantInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "user": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "external_name": {
          "type": "string"
        },
        "external_email": {
          "type": "string",
          "format": "email"
        },
        "role": {
          "type": "string",
          "enum": [
            "required",
            "optional",
            "organizer"
          ],
          "default": "required"
        },
        "response_status": {
          "type": "string",
          "enum": [
            "needs_action",
            "accepted",
            "declined",
            "tentative"
          ],
          "default": "needs_action"
        }
      }
    }
  }
}