{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/australia-post/main/json-schema/australia-post-work-centres-response-schema.json",
  "title": "WorkCentresResponse",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/australia-post-locations-v3-openapi.yml#/components/schemas/WorkCentresResponse",
  "type": "object",
  "properties": {
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "workcentres": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkCentre"
      }
    }
  },
  "$defs": {
    "CapabilityCategory": {
      "required": [
        "id",
        "name"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "CapabilityCurrentHours": {
      "type": "object",
      "properties": {
        "periods": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CurrentHourPeriod"
          }
        }
      }
    },
    "CapabilityLocation": {
      "required": [
        "attributes",
        "id",
        "type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "attributes": {
          "required": [
            "lat",
            "lon",
            "name"
          ],
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "format": "double"
            },
            "lon": {
              "type": "number",
              "format": "double"
            },
            "name": {
              "type": "string"
            }
          }
        }
      },
      "description": "Location details for the operation capability (for future use)"
    },
    "CapabilityStandardHours": {
      "type": "object",
      "properties": {
        "periods": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StandardHourPeriod"
          }
        }
      }
    },
    "CurrentHourPeriod": {
      "required": [
        "day",
        "type"
      ],
      "type": "object",
      "properties": {
        "day": {
          "type": "string",
          "enum": [
            "MON",
            "TUE",
            "WED",
            "THU",
            "FRI",
            "SAT",
            "SUN"
          ]
        },
        "open": {
          "$ref": "#/$defs/HourMinute"
        },
        "close": {
          "$ref": "#/$defs/HourMinute"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "HourMinute": {
      "required": [
        "hour",
        "minute"
      ],
      "type": "object",
      "properties": {
        "hour": {
          "maximum": 23,
          "minimum": 0,
          "type": "integer"
        },
        "minute": {
          "maximum": 59,
          "minimum": 0,
          "type": "integer"
        }
      }
    },
    "OperationalCapability": {
      "required": [
        "attributes",
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "attributes": {
          "$ref": "#/$defs/OperationalCapabilityAttributes"
        }
      }
    },
    "OperationalCapabilityAttributes": {
      "required": [
        "appointment_required",
        "categories",
        "name",
        "service_offering"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "current_hours": {
          "$ref": "#/$defs/CapabilityCurrentHours"
        },
        "standard_hours": {
          "$ref": "#/$defs/CapabilityStandardHours"
        },
        "description": {
          "type": "string"
        },
        "appointment_required": {
          "type": "string"
        },
        "service_offering": {
          "type": "boolean"
        },
        "categories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CapabilityCategory"
          }
        },
        "location": {
          "$ref": "#/$defs/CapabilityLocation"
        }
      }
    },
    "Pagination": {
      "required": [
        "offset",
        "size",
        "total"
      ],
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "description": "Total number of matches ignoring pagination.",
          "format": "int64"
        },
        "offset": {
          "type": "integer",
          "description": "Current offset (number of items skipped).",
          "format": "int32"
        },
        "size": {
          "type": "integer",
          "description": "Page size (number of items returned in this page).",
          "format": "int32"
        }
      },
      "description": "Pagination metadata for list responses."
    },
    "StandardHourPeriod": {
      "required": [
        "close",
        "day",
        "open"
      ],
      "type": "object",
      "properties": {
        "day": {
          "type": "string",
          "enum": [
            "MON",
            "TUE",
            "WED",
            "THU",
            "FRI",
            "SAT",
            "SUN"
          ]
        },
        "open": {
          "$ref": "#/$defs/HourMinute"
        },
        "close": {
          "$ref": "#/$defs/HourMinute"
        }
      }
    },
    "WorkCentre": {
      "required": [
        "attributes",
        "id",
        "location",
        "type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the workcentre object. Ex: 337586_PO, 96286800_UPL"
        },
        "type": {
          "type": "string",
          "description": "Work centre type (PO, UPL, DC, R_SPB, C_SPB)."
        },
        "attributes": {
          "$ref": "#/$defs/WorkCentreAttributes"
        },
        "location": {
          "$ref": "#/$defs/WorkCentreLocation"
        }
      }
    },
    "WorkCentreAddress": {
      "required": [
        "attributes",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "attributes": {
          "$ref": "#/$defs/WorkCentreAddressAttributes"
        }
      }
    },
    "WorkCentreAddressAttributes": {
      "required": [
        "address_line_1",
        "country_code",
        "country_name",
        "dpid",
        "postcode",
        "state",
        "suburb"
      ],
      "type": "object",
      "properties": {
        "address_line_1": {
          "type": "string"
        },
        "address_line_2": {
          "type": "string"
        },
        "address_line_3": {
          "type": "string"
        },
        "directions": {
          "type": "string"
        },
        "suburb": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postcode": {
          "type": "string"
        },
        "country_name": {
          "type": "string"
        },
        "country_code": {
          "type": "string"
        },
        "dpid": {
          "type": "string"
        }
      }
    },
    "WorkCentreAttributes": {
      "required": [
        "business_name",
        "org_unit_type_description",
        "work_centre_id"
      ],
      "type": "object",
      "properties": {
        "business_name": {
          "type": "string"
        },
        "business_long_name": {
          "type": "string"
        },
        "work_centre_id": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        },
        "fax_number": {
          "type": "string"
        },
        "access_restriction_code": {
          "type": "string",
          "description": "Indicates the access restriction for parcel lockers."
        },
        "location_type_code": {
          "type": "string",
          "description": "Indicates the location type code for parcel lockers."
        },
        "org_unit_type_description": {
          "type": "string"
        },
        "operational_capabilities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OperationalCapability"
          }
        }
      }
    },
    "WorkCentreLocation": {
      "required": [
        "addresses",
        "attributes"
      ],
      "type": "object",
      "properties": {
        "attributes": {
          "$ref": "#/$defs/WorkCentreLocationAttributes"
        },
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkCentreAddress"
          }
        }
      }
    },
    "WorkCentreLocationAttributes": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double"
        },
        "lon": {
          "type": "number",
          "format": "double"
        },
        "distance": {
          "type": "number",
          "format": "double"
        }
      }
    }
  }
}