{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/when-i-work/json-schema/when-i-work-availability-event-schema.json",
  "title": "AvailabilityEvent",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/when-i-work-availabilities-api-openapi.yml#/components/schemas/AvailabilityEvent",
  "type": "object",
  "required": [
    "start_time",
    "type"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "account_id": {
      "type": "integer"
    },
    "user_id": {
      "type": "integer"
    },
    "login_id": {
      "type": "string"
    },
    "type": {
      "type": "integer",
      "enum": [
        1,
        2
      ],
      "description": "Type code. 1 for \"unavailable\", 2 for \"preferred\""
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "description": "Start time of the event. Must be no more than 24 hours in the past"
    },
    "end_time": {
      "type": "string",
      "format": "date-time",
      "description": "End time of the event. If \"all_day\" is sent and true, this field is optional"
    },
    "all_day": {
      "type": "boolean"
    },
    "notes": {
      "type": "string",
      "description": "Maximum of 160 characters"
    },
    "recurrence": {
      "type": "string",
      "description": "Recurrence rule. See https://tools.ietf.org/html/rfc5545"
    },
    "recurrence_end": {
      "type": "string",
      "readOnly": true,
      "format": "date-time",
      "description": "End date of the recurring series. Null for \"does not repeat\" or \"repeats infinitely\""
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}