{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bodyspec/json-schema/bodyspec-availability-response-schema.json",
  "title": "AvailabilityResponse",
  "description": "Response model for availability endpoint.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bodyspec-availability-api-openapi.yml#/components/schemas/AvailabilityResponse",
  "properties": {
    "slots": {
      "items": {
        "$ref": "#/$defs/AvailabilitySlot"
      },
      "type": "array",
      "title": "Slots",
      "description": "List of available appointment slots"
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "max_availability_days": {
      "type": "integer",
      "title": "Max Availability Days",
      "description": "Maximum number of days in the future availability can be queried"
    }
  },
  "type": "object",
  "required": [
    "slots",
    "pagination",
    "max_availability_days"
  ],
  "x-internal": true,
  "$defs": {
    "AvailabilitySlot": {
      "properties": {
        "appt_id": {
          "type": "string",
          "title": "Appt Id",
          "description": "Unique identifier for the appointment slot"
        },
        "location_id": {
          "type": "string",
          "title": "Location Id",
          "description": "Location identifier where the appointment is available"
        },
        "service_id": {
          "type": "string",
          "title": "Service Id",
          "description": "Service/product identifier for this appointment"
        },
        "start_time": {
          "type": "string",
          "format": "date-time",
          "title": "Start Time",
          "description": "Appointment start time in location's local timezone (ISO 8601 with offset)"
        },
        "duration_minutes": {
          "type": "integer",
          "title": "Duration Minutes",
          "description": "Duration of the appointment in minutes"
        },
        "timezone": {
          "type": "string",
          "title": "Timezone",
          "description": "IANA timezone identifier for the location (e.g., 'America/Los_Angeles')"
        },
        "is_available": {
          "type": "boolean",
          "title": "Is Available",
          "description": "Whether this slot is currently available for booking",
          "default": true
        }
      },
      "type": "object",
      "required": [
        "appt_id",
        "location_id",
        "service_id",
        "start_time",
        "duration_minutes",
        "timezone"
      ],
      "title": "AvailabilitySlot",
      "description": "Represents an available appointment slot."
    },
    "Pagination": {
      "properties": {
        "page": {
          "type": "integer",
          "title": "Page",
          "description": "Current page number"
        },
        "page_size": {
          "type": "integer",
          "title": "Page Size",
          "description": "Number of items per page"
        },
        "results": {
          "type": "integer",
          "title": "Results",
          "description": "Number of results in this page"
        },
        "has_more": {
          "type": "boolean",
          "title": "Has More",
          "description": "Whether more results exist after this page"
        }
      },
      "type": "object",
      "required": [
        "page",
        "page_size",
        "results",
        "has_more"
      ],
      "title": "Pagination",
      "description": "Pagination information for list responses.",
      "x-internal": true
    }
  }
}