{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://json-schema.org/openstudio-urban-modeling/thermal_connector_properties.json#",
  "title": "URBANopt Thermal Connector",
  "description": "Schema for an URBANopt Thermal Connector object",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique id used to refer to this feature within this dataset.",
      "type": "string"
    },
    "project_id": {
      "description": "Project which this feature belongs to.",
      "type": "string"
    },
    "type": {
      "description": "Type of feature.",
      "type": "string",
      "enum": [
        "ThermalConnector"
      ]
    },
    "source_name": {
      "description": "Name of the original data source.",
      "type": "string"
    },
    "source_id": {
      "description": "Id of the feature in original data source.",
      "type": "string"
    },
    "name": {
      "description": "Feature name",
      "type": "string"
    },
    "connector_type": {
      "$ref": "#/definitions/ThermalConnectorType"
    },
    "lengths": {
      "description": "Length of each segment in ft, generated on export.",
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "total_length": {
      "description": "Total length of the connector in ft, generated on export.",
      "type": "number"
    },
    "startJunctionId": {
      "description": "Id of the junction that this connector starts at.",
      "type": "string"
    },
    "endJunctionId": {
      "description": "Id of the junction that this connector ends at.",
      "type": "string"
    },
    "fluid_temperature_type": {
      "description": "Classification of temperature range of fluid in this connector",
      "$ref": "#/definitions/TemperatureType"
    },
    "flow_direction": {
      "description": "Charcterization of connector, relative to the central plant",
      "$ref": "#/definitions/FlowDirection"
    },
    "user_data": {
      "description": "Arbitrary user data"
    }
  },
  "required": [
    "type",
    "connector_type",
    "startJunctionId",
    "endJunctionId",
    "fluid_temperature_type",
    "flow_direction"
  ],
  "additionalProperties": false,
  "definitions": {
    "ThermalConnectorType": {
      "description": "Type of thermal connector.",
      "type": "string",
      "enum": [
        "OnePipe",
        "TwoPipe",
        "ThreePipe",
        "FourPipe"
      ]
    },
    "TemperatureType": {
      "description": "Temperature of fluid flowing in connector.",
      "type": "string",
      "enum": [
        "Hot",
        "Cold",
        "Ambient"
      ]
    },
    "FlowDirection": {
      "description": "Direction of flow from start junction to end junction.",
      "type": "string",
      "enum": [
        "Supply",
        "Return",
        "Unspecified"
      ]
    }
  }
}