{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atatravel-cloud/json-schema/atatravel-cloud-availability-calendar-schema.json",
  "title": "AvailabilityCalendar",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atatravel-cloud-openapi.json#/components/schemas/AvailabilityCalendar",
  "type": "object",
  "required": [
    "publicToken",
    "scope",
    "start",
    "days",
    "adults",
    "children",
    "dates"
  ],
  "properties": {
    "publicToken": {
      "type": "string"
    },
    "scope": {
      "type": "string",
      "enum": [
        "property",
        "room"
      ]
    },
    "roomId": {
      "type": [
        "string",
        "null"
      ]
    },
    "start": {
      "type": "string",
      "format": "date"
    },
    "days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "adults": {
      "type": "integer",
      "minimum": 1
    },
    "children": {
      "type": "integer",
      "minimum": 0
    },
    "dates": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AvailabilityDay"
      }
    }
  },
  "$defs": {
    "AvailabilityDay": {
      "type": "object",
      "required": [
        "date",
        "available",
        "availableUnits",
        "currency"
      ],
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "available": {
          "type": "boolean"
        },
        "availableUnits": {
          "type": "integer",
          "minimum": 0
        },
        "totalUnits": {
          "type": "integer",
          "minimum": 0
        },
        "roomId": {
          "type": [
            "string",
            "null"
          ]
        },
        "ratePlanId": {
          "type": [
            "string",
            "null"
          ]
        },
        "price": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "minStay": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "maxStay": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "closedToArrival": {
          "type": "boolean"
        },
        "closedToDeparture": {
          "type": "boolean"
        },
        "stopSell": {
          "type": "boolean"
        }
      }
    }
  }
}