dragonfly-schema 1.12.1-v10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/helpers/class-validator.ts +94 -0
  2. package/index.ts +1 -0
  3. package/models/Building.ts +98 -0
  4. package/models/BuildingEnergyPropertiesAbridged.ts +65 -0
  5. package/models/BuildingPropertiesAbridged.ts +73 -0
  6. package/models/BuildingRadiancePropertiesAbridged.ts +63 -0
  7. package/models/ContextShade.ts +83 -0
  8. package/models/ContextShadeEnergyPropertiesAbridged.ts +74 -0
  9. package/models/ContextShadePropertiesAbridged.ts +73 -0
  10. package/models/ContextShadeRadiancePropertiesAbridged.ts +63 -0
  11. package/models/DetailedSkylights.ts +73 -0
  12. package/models/DetailedWindows.ts +73 -0
  13. package/models/ExteriorApertureGridParameter.ts +74 -0
  14. package/models/ExteriorApertureType.ts +8 -0
  15. package/models/ExteriorFaceGridParameter.ts +82 -0
  16. package/models/ExteriorFaceType.ts +9 -0
  17. package/models/ExtrudedBorder.ts +63 -0
  18. package/models/GriddedSkylightArea.ts +71 -0
  19. package/models/GriddedSkylightRatio.ts +71 -0
  20. package/models/LouversByCount.ts +63 -0
  21. package/models/LouversByDistance.ts +63 -0
  22. package/models/Model.ts +125 -0
  23. package/models/ModelEnergyProperties.ts +606 -0
  24. package/models/ModelProperties.ts +73 -0
  25. package/models/ModelRadianceProperties.ts +253 -0
  26. package/models/Overhang.ts +73 -0
  27. package/models/RectangularWindows.ts +89 -0
  28. package/models/RepeatingWindowRatio.ts +94 -0
  29. package/models/RoofSpecification.ts +67 -0
  30. package/models/Room2D.ts +166 -0
  31. package/models/Room2DEnergyPropertiesAbridged.ts +123 -0
  32. package/models/Room2DPropertiesAbridged.ts +73 -0
  33. package/models/Room2DRadiancePropertiesAbridged.ts +74 -0
  34. package/models/RoomGridParameter.ts +72 -0
  35. package/models/RoomRadialGridParameter.ts +80 -0
  36. package/models/SimpleWindowArea.ts +71 -0
  37. package/models/SimpleWindowRatio.ts +71 -0
  38. package/models/SingleWindow.ts +78 -0
  39. package/models/Story.ts +111 -0
  40. package/models/StoryEnergyPropertiesAbridged.ts +65 -0
  41. package/models/StoryPropertiesAbridged.ts +73 -0
  42. package/models/StoryRadiancePropertiesAbridged.ts +63 -0
  43. package/models/_GridParameterBase.ts +71 -0
  44. package/models/_LouversBase.ts +99 -0
  45. package/models/_OpenAPIGenBaseModel.ts +38 -0
  46. package/models/_WindowParameterBase.ts +62 -0
  47. package/models/index.ts +46 -0
  48. package/package.json +28 -0
  49. package/tsconfig.json +32 -0
  50. package/vite.config.ts +14 -0
@@ -0,0 +1,606 @@
1
+ import { IsString, IsOptional, Matches, IsInstance, ValidateNested, IsArray, validate, ValidationError as TsValidationError } from 'class-validator';
2
+ import { Type, plainToClass, instanceToPlain } from 'class-transformer';
3
+ import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
4
+ import { AirBoundaryConstruction } from "honeybee-schema";
5
+ import { AirBoundaryConstructionAbridged } from "honeybee-schema";
6
+ import { Baseboard } from "honeybee-schema";
7
+ import { ConstructionSet } from "honeybee-schema";
8
+ import { ConstructionSetAbridged } from "honeybee-schema";
9
+ import { DetailedHVAC } from "honeybee-schema";
10
+ import { EnergyMaterial } from "honeybee-schema";
11
+ import { EnergyMaterialNoMass } from "honeybee-schema";
12
+ import { EnergyMaterialVegetation } from "honeybee-schema";
13
+ import { EnergyWindowFrame } from "honeybee-schema";
14
+ import { EnergyWindowMaterialBlind } from "honeybee-schema";
15
+ import { EnergyWindowMaterialGas } from "honeybee-schema";
16
+ import { EnergyWindowMaterialGasCustom } from "honeybee-schema";
17
+ import { EnergyWindowMaterialGasMixture } from "honeybee-schema";
18
+ import { EnergyWindowMaterialGlazing } from "honeybee-schema";
19
+ import { EnergyWindowMaterialShade } from "honeybee-schema";
20
+ import { EnergyWindowMaterialSimpleGlazSys } from "honeybee-schema";
21
+ import { EvaporativeCooler } from "honeybee-schema";
22
+ import { FCU } from "honeybee-schema";
23
+ import { FCUwithDOASAbridged } from "honeybee-schema";
24
+ import { ForcedAirFurnace } from "honeybee-schema";
25
+ import { GasUnitHeater } from "honeybee-schema";
26
+ import { GlobalConstructionSet } from "honeybee-schema";
27
+ import { IdealAirSystemAbridged } from "honeybee-schema";
28
+ import { OpaqueConstruction } from "honeybee-schema";
29
+ import { OpaqueConstructionAbridged } from "honeybee-schema";
30
+ import { ProgramType } from "honeybee-schema";
31
+ import { ProgramTypeAbridged } from "honeybee-schema";
32
+ import { PSZ } from "honeybee-schema";
33
+ import { PTAC } from "honeybee-schema";
34
+ import { PVAV } from "honeybee-schema";
35
+ import { Radiant } from "honeybee-schema";
36
+ import { RadiantwithDOASAbridged } from "honeybee-schema";
37
+ import { Residential } from "honeybee-schema";
38
+ import { ScheduleFixedInterval } from "honeybee-schema";
39
+ import { ScheduleFixedIntervalAbridged } from "honeybee-schema";
40
+ import { ScheduleRuleset } from "honeybee-schema";
41
+ import { ScheduleRulesetAbridged } from "honeybee-schema";
42
+ import { ScheduleTypeLimit } from "honeybee-schema";
43
+ import { ShadeConstruction } from "honeybee-schema";
44
+ import { SHWSystem } from "honeybee-schema";
45
+ import { VAV } from "honeybee-schema";
46
+ import { VRF } from "honeybee-schema";
47
+ import { VRFwithDOASAbridged } from "honeybee-schema";
48
+ import { WindowAC } from "honeybee-schema";
49
+ import { WindowConstruction } from "honeybee-schema";
50
+ import { WindowConstructionAbridged } from "honeybee-schema";
51
+ import { WSHP } from "honeybee-schema";
52
+ import { WSHPwithDOASAbridged } from "honeybee-schema";
53
+
54
+ /** Base class for all objects that are not extensible with additional keys.\n\nThis effectively includes all objects except for the Properties classes\nthat are assigned to geometry objects. */
55
+ export class ModelEnergyProperties extends _OpenAPIGenBaseModel {
56
+ @IsString()
57
+ @IsOptional()
58
+ @Matches(/^ModelEnergyProperties$/)
59
+ type?: string;
60
+
61
+ @IsInstance(GlobalConstructionSet)
62
+ @Type(() => GlobalConstructionSet)
63
+ @ValidateNested()
64
+ @IsOptional()
65
+ /** Global Energy construction set. */
66
+ global_construction_set?: GlobalConstructionSet;
67
+
68
+ @IsArray()
69
+ @IsOptional()
70
+ /** List of all ConstructionSets in the Model. */
71
+ construction_sets?: (ConstructionSetAbridged | ConstructionSet) [];
72
+
73
+ @IsArray()
74
+ @IsOptional()
75
+ /** A list of all unique constructions in the model. This includes constructions across all the Model construction_sets. */
76
+ constructions?: (OpaqueConstructionAbridged | WindowConstructionAbridged | ShadeConstruction | AirBoundaryConstructionAbridged | OpaqueConstruction | WindowConstruction | AirBoundaryConstruction) [];
77
+
78
+ @IsArray()
79
+ @IsOptional()
80
+ /** A list of all unique materials in the model. This includes materials needed to make the Model constructions. */
81
+ materials?: (EnergyMaterial | EnergyMaterialNoMass | EnergyMaterialVegetation | EnergyWindowMaterialGlazing | EnergyWindowMaterialSimpleGlazSys | EnergyWindowMaterialGas | EnergyWindowMaterialGasMixture | EnergyWindowMaterialGasCustom | EnergyWindowFrame | EnergyWindowMaterialBlind | EnergyWindowMaterialShade) [];
82
+
83
+ @IsArray()
84
+ @IsOptional()
85
+ /** List of all HVAC systems in the Model. */
86
+ hvacs?: (IdealAirSystemAbridged | VAV | PVAV | PSZ | PTAC | ForcedAirFurnace | FCUwithDOASAbridged | WSHPwithDOASAbridged | VRFwithDOASAbridged | RadiantwithDOASAbridged | FCU | WSHP | VRF | Baseboard | EvaporativeCooler | Residential | WindowAC | GasUnitHeater | Radiant | DetailedHVAC) [];
87
+
88
+ @IsArray()
89
+ @IsInstance(SHWSystem, { each: true })
90
+ @Type(() => SHWSystem)
91
+ @ValidateNested({ each: true })
92
+ @IsOptional()
93
+ /** List of all Service Hot Water (SHW) systems in the Model. */
94
+ shws?: SHWSystem [];
95
+
96
+ @IsArray()
97
+ @IsOptional()
98
+ /** List of all ProgramTypes in the Model. */
99
+ program_types?: (ProgramTypeAbridged | ProgramType) [];
100
+
101
+ @IsArray()
102
+ @IsOptional()
103
+ /** A list of all unique schedules in the model. This includes schedules across all HVAC systems, ProgramTypes and ContextShades. */
104
+ schedules?: (ScheduleRulesetAbridged | ScheduleFixedIntervalAbridged | ScheduleRuleset | ScheduleFixedInterval) [];
105
+
106
+ @IsArray()
107
+ @IsInstance(ScheduleTypeLimit, { each: true })
108
+ @Type(() => ScheduleTypeLimit)
109
+ @ValidateNested({ each: true })
110
+ @IsOptional()
111
+ /** A list of all unique ScheduleTypeLimits in the model. This all ScheduleTypeLimits needed to make the Model schedules. */
112
+ schedule_type_limits?: ScheduleTypeLimit [];
113
+
114
+
115
+ constructor() {
116
+ super();
117
+ this.type = "ModelEnergyProperties";
118
+ this.global_construction_set = GlobalConstructionSet.fromJS({
119
+ "type": "GlobalConstructionSet",
120
+ "materials": [
121
+ {
122
+ "identifier": "Generic Roof Membrane",
123
+ "display_name": null,
124
+ "user_data": null,
125
+ "type": "EnergyMaterial",
126
+ "roughness": "MediumRough",
127
+ "thickness": 0.01,
128
+ "conductivity": 0.16,
129
+ "density": 1120.0,
130
+ "specific_heat": 1460.0,
131
+ "thermal_absorptance": 0.9,
132
+ "solar_absorptance": 0.65,
133
+ "visible_absorptance": 0.65
134
+ },
135
+ {
136
+ "identifier": "Generic Acoustic Tile",
137
+ "display_name": null,
138
+ "user_data": null,
139
+ "type": "EnergyMaterial",
140
+ "roughness": "MediumSmooth",
141
+ "thickness": 0.02,
142
+ "conductivity": 0.06,
143
+ "density": 368.0,
144
+ "specific_heat": 590.0,
145
+ "thermal_absorptance": 0.9,
146
+ "solar_absorptance": 0.2,
147
+ "visible_absorptance": 0.2
148
+ },
149
+ {
150
+ "identifier": "Generic 25mm Wood",
151
+ "display_name": null,
152
+ "user_data": null,
153
+ "type": "EnergyMaterial",
154
+ "roughness": "MediumSmooth",
155
+ "thickness": 0.0254,
156
+ "conductivity": 0.15,
157
+ "density": 608.0,
158
+ "specific_heat": 1630.0,
159
+ "thermal_absorptance": 0.9,
160
+ "solar_absorptance": 0.5,
161
+ "visible_absorptance": 0.5
162
+ },
163
+ {
164
+ "identifier": "Generic HW Concrete",
165
+ "display_name": null,
166
+ "user_data": null,
167
+ "type": "EnergyMaterial",
168
+ "roughness": "MediumRough",
169
+ "thickness": 0.2,
170
+ "conductivity": 1.95,
171
+ "density": 2240.0,
172
+ "specific_heat": 900.0,
173
+ "thermal_absorptance": 0.9,
174
+ "solar_absorptance": 0.8,
175
+ "visible_absorptance": 0.8
176
+ },
177
+ {
178
+ "identifier": "Generic Window Air Gap",
179
+ "display_name": null,
180
+ "user_data": null,
181
+ "type": "EnergyWindowMaterialGas",
182
+ "thickness": 0.0127,
183
+ "gas_type": "Air"
184
+ },
185
+ {
186
+ "identifier": "Generic Gypsum Board",
187
+ "display_name": null,
188
+ "user_data": null,
189
+ "type": "EnergyMaterial",
190
+ "roughness": "MediumSmooth",
191
+ "thickness": 0.0127,
192
+ "conductivity": 0.16,
193
+ "density": 800.0,
194
+ "specific_heat": 1090.0,
195
+ "thermal_absorptance": 0.9,
196
+ "solar_absorptance": 0.5,
197
+ "visible_absorptance": 0.5
198
+ },
199
+ {
200
+ "identifier": "Generic Wall Air Gap",
201
+ "display_name": null,
202
+ "user_data": null,
203
+ "type": "EnergyMaterial",
204
+ "roughness": "Smooth",
205
+ "thickness": 0.1,
206
+ "conductivity": 0.667,
207
+ "density": 1.28,
208
+ "specific_heat": 1000.0,
209
+ "thermal_absorptance": 0.9,
210
+ "solar_absorptance": 0.7,
211
+ "visible_absorptance": 0.7
212
+ },
213
+ {
214
+ "identifier": "Generic Ceiling Air Gap",
215
+ "display_name": null,
216
+ "user_data": null,
217
+ "type": "EnergyMaterial",
218
+ "roughness": "Smooth",
219
+ "thickness": 0.1,
220
+ "conductivity": 0.556,
221
+ "density": 1.28,
222
+ "specific_heat": 1000.0,
223
+ "thermal_absorptance": 0.9,
224
+ "solar_absorptance": 0.7,
225
+ "visible_absorptance": 0.7
226
+ },
227
+ {
228
+ "identifier": "Generic Brick",
229
+ "display_name": null,
230
+ "user_data": null,
231
+ "type": "EnergyMaterial",
232
+ "roughness": "MediumRough",
233
+ "thickness": 0.1,
234
+ "conductivity": 0.9,
235
+ "density": 1920.0,
236
+ "specific_heat": 790.0,
237
+ "thermal_absorptance": 0.9,
238
+ "solar_absorptance": 0.65,
239
+ "visible_absorptance": 0.65
240
+ },
241
+ {
242
+ "identifier": "Generic 50mm Insulation",
243
+ "display_name": null,
244
+ "user_data": null,
245
+ "type": "EnergyMaterial",
246
+ "roughness": "MediumRough",
247
+ "thickness": 0.05,
248
+ "conductivity": 0.03,
249
+ "density": 43.0,
250
+ "specific_heat": 1210.0,
251
+ "thermal_absorptance": 0.9,
252
+ "solar_absorptance": 0.7,
253
+ "visible_absorptance": 0.7
254
+ },
255
+ {
256
+ "identifier": "Generic Low-e Glass",
257
+ "display_name": null,
258
+ "user_data": null,
259
+ "type": "EnergyWindowMaterialGlazing",
260
+ "thickness": 0.006,
261
+ "solar_transmittance": 0.45,
262
+ "solar_reflectance": 0.36,
263
+ "solar_reflectance_back": 0.36,
264
+ "visible_transmittance": 0.71,
265
+ "visible_reflectance": 0.21,
266
+ "visible_reflectance_back": 0.21,
267
+ "infrared_transmittance": 0.0,
268
+ "emissivity": 0.84,
269
+ "emissivity_back": 0.047,
270
+ "conductivity": 1.0,
271
+ "dirt_correction": 1.0,
272
+ "solar_diffusing": false
273
+ },
274
+ {
275
+ "identifier": "Generic Painted Metal",
276
+ "display_name": null,
277
+ "user_data": null,
278
+ "type": "EnergyMaterial",
279
+ "roughness": "Smooth",
280
+ "thickness": 0.0015,
281
+ "conductivity": 45.0,
282
+ "density": 7690.0,
283
+ "specific_heat": 410.0,
284
+ "thermal_absorptance": 0.9,
285
+ "solar_absorptance": 0.5,
286
+ "visible_absorptance": 0.5
287
+ },
288
+ {
289
+ "identifier": "Generic LW Concrete",
290
+ "display_name": null,
291
+ "user_data": null,
292
+ "type": "EnergyMaterial",
293
+ "roughness": "MediumRough",
294
+ "thickness": 0.1,
295
+ "conductivity": 0.53,
296
+ "density": 1280.0,
297
+ "specific_heat": 840.0,
298
+ "thermal_absorptance": 0.9,
299
+ "solar_absorptance": 0.8,
300
+ "visible_absorptance": 0.8
301
+ },
302
+ {
303
+ "identifier": "Generic 25mm Insulation",
304
+ "display_name": null,
305
+ "user_data": null,
306
+ "type": "EnergyMaterial",
307
+ "roughness": "MediumRough",
308
+ "thickness": 0.025,
309
+ "conductivity": 0.03,
310
+ "density": 43.0,
311
+ "specific_heat": 1210.0,
312
+ "thermal_absorptance": 0.9,
313
+ "solar_absorptance": 0.7,
314
+ "visible_absorptance": 0.7
315
+ },
316
+ {
317
+ "identifier": "Generic Clear Glass",
318
+ "display_name": null,
319
+ "user_data": null,
320
+ "type": "EnergyWindowMaterialGlazing",
321
+ "thickness": 0.006,
322
+ "solar_transmittance": 0.77,
323
+ "solar_reflectance": 0.07,
324
+ "solar_reflectance_back": 0.07,
325
+ "visible_transmittance": 0.88,
326
+ "visible_reflectance": 0.08,
327
+ "visible_reflectance_back": 0.08,
328
+ "infrared_transmittance": 0.0,
329
+ "emissivity": 0.84,
330
+ "emissivity_back": 0.84,
331
+ "conductivity": 1.0,
332
+ "dirt_correction": 1.0,
333
+ "solar_diffusing": false
334
+ }
335
+ ],
336
+ "constructions": [
337
+ {
338
+ "identifier": "Generic Interior Door",
339
+ "display_name": null,
340
+ "user_data": null,
341
+ "type": "OpaqueConstructionAbridged",
342
+ "materials": [
343
+ "Generic 25mm Wood"
344
+ ]
345
+ },
346
+ {
347
+ "identifier": "Generic Single Pane",
348
+ "display_name": null,
349
+ "user_data": null,
350
+ "type": "WindowConstructionAbridged",
351
+ "materials": [
352
+ "Generic Clear Glass"
353
+ ],
354
+ "frame": null
355
+ },
356
+ {
357
+ "identifier": "Generic Shade",
358
+ "display_name": null,
359
+ "user_data": null,
360
+ "type": "ShadeConstruction",
361
+ "solar_reflectance": 0.35,
362
+ "visible_reflectance": 0.35,
363
+ "is_specular": false
364
+ },
365
+ {
366
+ "identifier": "Generic Context",
367
+ "display_name": null,
368
+ "user_data": null,
369
+ "type": "ShadeConstruction",
370
+ "solar_reflectance": 0.2,
371
+ "visible_reflectance": 0.2,
372
+ "is_specular": false
373
+ },
374
+ {
375
+ "identifier": "Generic Interior Ceiling",
376
+ "display_name": null,
377
+ "user_data": null,
378
+ "type": "OpaqueConstructionAbridged",
379
+ "materials": [
380
+ "Generic LW Concrete",
381
+ "Generic Ceiling Air Gap",
382
+ "Generic Acoustic Tile"
383
+ ]
384
+ },
385
+ {
386
+ "identifier": "Generic Interior Wall",
387
+ "display_name": null,
388
+ "user_data": null,
389
+ "type": "OpaqueConstructionAbridged",
390
+ "materials": [
391
+ "Generic Gypsum Board",
392
+ "Generic Wall Air Gap",
393
+ "Generic Gypsum Board"
394
+ ]
395
+ },
396
+ {
397
+ "identifier": "Generic Exposed Floor",
398
+ "display_name": null,
399
+ "user_data": null,
400
+ "type": "OpaqueConstructionAbridged",
401
+ "materials": [
402
+ "Generic Painted Metal",
403
+ "Generic Ceiling Air Gap",
404
+ "Generic 50mm Insulation",
405
+ "Generic LW Concrete"
406
+ ]
407
+ },
408
+ {
409
+ "identifier": "Generic Interior Floor",
410
+ "display_name": null,
411
+ "user_data": null,
412
+ "type": "OpaqueConstructionAbridged",
413
+ "materials": [
414
+ "Generic Acoustic Tile",
415
+ "Generic Ceiling Air Gap",
416
+ "Generic LW Concrete"
417
+ ]
418
+ },
419
+ {
420
+ "identifier": "Generic Ground Slab",
421
+ "display_name": null,
422
+ "user_data": null,
423
+ "type": "OpaqueConstructionAbridged",
424
+ "materials": [
425
+ "Generic 50mm Insulation",
426
+ "Generic HW Concrete"
427
+ ]
428
+ },
429
+ {
430
+ "identifier": "Generic Roof",
431
+ "display_name": null,
432
+ "user_data": null,
433
+ "type": "OpaqueConstructionAbridged",
434
+ "materials": [
435
+ "Generic Roof Membrane",
436
+ "Generic 50mm Insulation",
437
+ "Generic LW Concrete",
438
+ "Generic Ceiling Air Gap",
439
+ "Generic Acoustic Tile"
440
+ ]
441
+ },
442
+ {
443
+ "identifier": "Generic Exterior Wall",
444
+ "display_name": null,
445
+ "user_data": null,
446
+ "type": "OpaqueConstructionAbridged",
447
+ "materials": [
448
+ "Generic Brick",
449
+ "Generic LW Concrete",
450
+ "Generic 50mm Insulation",
451
+ "Generic Wall Air Gap",
452
+ "Generic Gypsum Board"
453
+ ]
454
+ },
455
+ {
456
+ "identifier": "Generic Underground Wall",
457
+ "display_name": null,
458
+ "user_data": null,
459
+ "type": "OpaqueConstructionAbridged",
460
+ "materials": [
461
+ "Generic 50mm Insulation",
462
+ "Generic HW Concrete",
463
+ "Generic Wall Air Gap",
464
+ "Generic Gypsum Board"
465
+ ]
466
+ },
467
+ {
468
+ "identifier": "Generic Air Boundary",
469
+ "display_name": null,
470
+ "user_data": null,
471
+ "type": "AirBoundaryConstructionAbridged",
472
+ "air_mixing_per_area": 0.1,
473
+ "air_mixing_schedule": "Always On"
474
+ },
475
+ {
476
+ "identifier": "Generic Underground Roof",
477
+ "display_name": null,
478
+ "user_data": null,
479
+ "type": "OpaqueConstructionAbridged",
480
+ "materials": [
481
+ "Generic 50mm Insulation",
482
+ "Generic HW Concrete",
483
+ "Generic Ceiling Air Gap",
484
+ "Generic Acoustic Tile"
485
+ ]
486
+ },
487
+ {
488
+ "identifier": "Generic Double Pane",
489
+ "display_name": null,
490
+ "user_data": null,
491
+ "type": "WindowConstructionAbridged",
492
+ "materials": [
493
+ "Generic Low-e Glass",
494
+ "Generic Window Air Gap",
495
+ "Generic Clear Glass"
496
+ ],
497
+ "frame": null
498
+ },
499
+ {
500
+ "identifier": "Generic Exterior Door",
501
+ "display_name": null,
502
+ "user_data": null,
503
+ "type": "OpaqueConstructionAbridged",
504
+ "materials": [
505
+ "Generic Painted Metal",
506
+ "Generic 25mm Insulation",
507
+ "Generic Painted Metal"
508
+ ]
509
+ }
510
+ ],
511
+ "wall_set": {
512
+ "interior_construction": "Generic Interior Wall",
513
+ "exterior_construction": "Generic Exterior Wall",
514
+ "ground_construction": "Generic Underground Wall",
515
+ "type": "WallConstructionSetAbridged"
516
+ },
517
+ "floor_set": {
518
+ "interior_construction": "Generic Interior Floor",
519
+ "exterior_construction": "Generic Exposed Floor",
520
+ "ground_construction": "Generic Ground Slab",
521
+ "type": "FloorConstructionSetAbridged"
522
+ },
523
+ "roof_ceiling_set": {
524
+ "interior_construction": "Generic Interior Ceiling",
525
+ "exterior_construction": "Generic Roof",
526
+ "ground_construction": "Generic Underground Roof",
527
+ "type": "RoofCeilingConstructionSetAbridged"
528
+ },
529
+ "aperture_set": {
530
+ "type": "ApertureConstructionSetAbridged",
531
+ "interior_construction": "Generic Single Pane",
532
+ "window_construction": "Generic Double Pane",
533
+ "skylight_construction": "Generic Double Pane",
534
+ "operable_construction": "Generic Double Pane"
535
+ },
536
+ "door_set": {
537
+ "type": "DoorConstructionSetAbridged",
538
+ "interior_construction": "Generic Interior Door",
539
+ "exterior_construction": "Generic Exterior Door",
540
+ "overhead_construction": "Generic Exterior Door",
541
+ "exterior_glass_construction": "Generic Double Pane",
542
+ "interior_glass_construction": "Generic Single Pane"
543
+ },
544
+ "shade_construction": "Generic Shade",
545
+ "context_construction": "Generic Context",
546
+ "air_boundary_construction": "Generic Air Boundary"
547
+ });
548
+ }
549
+
550
+
551
+ override init(_data?: any) {
552
+ super.init(_data);
553
+ if (_data) {
554
+ const obj = plainToClass(ModelEnergyProperties, _data);
555
+ this.type = obj.type;
556
+ this.global_construction_set = obj.global_construction_set;
557
+ this.construction_sets = obj.construction_sets;
558
+ this.constructions = obj.constructions;
559
+ this.materials = obj.materials;
560
+ this.hvacs = obj.hvacs;
561
+ this.shws = obj.shws;
562
+ this.program_types = obj.program_types;
563
+ this.schedules = obj.schedules;
564
+ this.schedule_type_limits = obj.schedule_type_limits;
565
+ }
566
+ }
567
+
568
+
569
+ static override fromJS(data: any): ModelEnergyProperties {
570
+ data = typeof data === 'object' ? data : {};
571
+
572
+ let result = new ModelEnergyProperties();
573
+ result.init(data);
574
+ return result;
575
+ }
576
+
577
+ override toJSON(data?: any) {
578
+ data = typeof data === 'object' ? data : {};
579
+ for (var property in this) {
580
+ if (this.hasOwnProperty(property))
581
+ data[property] = this[property];
582
+ }
583
+
584
+ data["type"] = this.type;
585
+ data["global_construction_set"] = this.global_construction_set;
586
+ data["construction_sets"] = this.construction_sets;
587
+ data["constructions"] = this.constructions;
588
+ data["materials"] = this.materials;
589
+ data["hvacs"] = this.hvacs;
590
+ data["shws"] = this.shws;
591
+ data["program_types"] = this.program_types;
592
+ data["schedules"] = this.schedules;
593
+ data["schedule_type_limits"] = this.schedule_type_limits;
594
+ data = super.toJSON(data);
595
+ return instanceToPlain(data);
596
+ }
597
+
598
+ async validate(): Promise<boolean> {
599
+ const errors = await validate(this);
600
+ if (errors.length > 0){
601
+ const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
602
+ throw new Error(`Validation failed: ${errorMessages}`);
603
+ }
604
+ return true;
605
+ }
606
+ }
@@ -0,0 +1,73 @@
1
+ import { IsString, IsOptional, Matches, IsInstance, ValidateNested, validate, ValidationError as TsValidationError } from 'class-validator';
2
+ import { Type, plainToClass, instanceToPlain } from 'class-transformer';
3
+ import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
4
+ import { ModelEnergyProperties } from "./ModelEnergyProperties";
5
+ import { ModelRadianceProperties } from "./ModelRadianceProperties";
6
+
7
+ export class ModelProperties extends _OpenAPIGenBaseModel {
8
+ @IsString()
9
+ @IsOptional()
10
+ @Matches(/^ModelProperties$/)
11
+ type?: string;
12
+
13
+ @IsInstance(ModelEnergyProperties)
14
+ @Type(() => ModelEnergyProperties)
15
+ @ValidateNested()
16
+ @IsOptional()
17
+ energy?: ModelEnergyProperties;
18
+
19
+ @IsInstance(ModelRadianceProperties)
20
+ @Type(() => ModelRadianceProperties)
21
+ @ValidateNested()
22
+ @IsOptional()
23
+ radiance?: ModelRadianceProperties;
24
+
25
+
26
+ constructor() {
27
+ super();
28
+ this.type = "ModelProperties";
29
+ }
30
+
31
+
32
+ override init(_data?: any) {
33
+ super.init(_data);
34
+ if (_data) {
35
+ const obj = plainToClass(ModelProperties, _data);
36
+ this.type = obj.type;
37
+ this.energy = obj.energy;
38
+ this.radiance = obj.radiance;
39
+ }
40
+ }
41
+
42
+
43
+ static override fromJS(data: any): ModelProperties {
44
+ data = typeof data === 'object' ? data : {};
45
+
46
+ let result = new ModelProperties();
47
+ result.init(data);
48
+ return result;
49
+ }
50
+
51
+ override toJSON(data?: any) {
52
+ data = typeof data === 'object' ? data : {};
53
+ for (var property in this) {
54
+ if (this.hasOwnProperty(property))
55
+ data[property] = this[property];
56
+ }
57
+
58
+ data["type"] = this.type;
59
+ data["energy"] = this.energy;
60
+ data["radiance"] = this.radiance;
61
+ data = super.toJSON(data);
62
+ return instanceToPlain(data);
63
+ }
64
+
65
+ async validate(): Promise<boolean> {
66
+ const errors = await validate(this);
67
+ if (errors.length > 0){
68
+ const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
69
+ throw new Error(`Validation failed: ${errorMessages}`);
70
+ }
71
+ return true;
72
+ }
73
+ }