import json
from importlib.resources import files

from .generated.models import (
    Ballast,
    BuildingEnergySimulationOutput,
    Building,
    ClimateSimulationOutput,
    Consumption,
    COOLINGSYSTEMTYPES,
    CoolingSimulationOutput,
    CoolingSystem,
    Duration,
    ENERGYSOURCES,
    GeometrySimulationOutput,
    HEATINGSYSTEMTYPES,
    HeatingSimulationOutput,
    HeatingSystem,
    HotWaterSystem,
    HotWaterSimulationOutput,
    HourPeak,
    LightingSimulationOutput,
    LightingControl,
    LightingSystem,
    LightingSystemTech,
    LocationSimulationOutput,
    METEOROLOGICALFILE,
    ModelValidation,
    Month,
    OpenBESCase,
    OpenBESMetaData,
    OpenBESOutput,
    OpenBESParameters as OpenBESParametersV2,
    OpenBESSpecification as OpenBESSpecificationV2,
    OccupationSchedule,
    Range,
    SpaceThermalDemandResult,
    TERRAINCLASS,
    ThermalSystemResult,
    VentilationSystem,
    VentilationSimulationOutput,
    VentilationSystemResult,
    Zone,
    ZoneSimultaneity,
)
from .conversion import toml_to_json, json_to_toml

with open(str(files("openbes.schemas") / "OpenBES.schema.json"), "r") as json_file:
    SPECIFICATION = json.load(json_file)
    SPECIFICATION_VERSION = SPECIFICATION["$version"]

__all__ = [
    "Ballast",
    "BuildingEnergySimulationOutput",
    "Building",
    "ClimateSimulationOutput",
    "Consumption",
    "COOLINGSYSTEMTYPES",
    "CoolingSimulationOutput",
    "CoolingSystem",
    "Duration",
    "ENERGYSOURCES",
    "GeometrySimulationOutput",
    "HEATINGSYSTEMTYPES",
    "HeatingSimulationOutput",
    "HeatingSystem",
    "HotWaterSystem",
    "HotWaterSimulationOutput",
    "HourPeak",
    "LightingSimulationOutput",
    "LightingControl",
    "LightingSystem",
    "LightingSystemTech",
    "LocationSimulationOutput",
    "METEOROLOGICALFILE",
    "ModelValidation",
    "Month",
    "OpenBESCase",
    "OpenBESMetaData",
    "OpenBESOutput",
    "OpenBESParametersV2",
    "OpenBESSpecificationV2",
    "OccupationSchedule",
    "Range",
    "SpaceThermalDemandResult",
    "TERRAINCLASS",
    "ThermalSystemResult",
    "VentilationSystem",
    "VentilationSimulationOutput",
    "VentilationSystemResult",
    "Zone",
    "ZoneSimultaneity",
    "toml_to_json",
    "json_to_toml",
    "SPECIFICATION",
    "SPECIFICATION_VERSION",
]
