Skip to content

Commit

Permalink
fix(TS): regenerate with the new generator
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Sep 17, 2024
1 parent e75bfa0 commit 514e81e
Show file tree
Hide file tree
Showing 43 changed files with 127 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .generator
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/Building.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsInstance, ValidateNested, IsDefined, IsString, IsOptional, Matches, IsArray, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { BuildingPropertiesAbridged } from "./BuildingPropertiesAbridged";
import { IDdBaseModel } from "honeybee-schema";
import { RoofSpecification } from "./RoofSpecification";
Expand Down Expand Up @@ -83,8 +83,8 @@ export class Building extends IDdBaseModel {
data["unique_stories"] = this.unique_stories;
data["room_3ds"] = this.room_3ds;
data["roof"] = this.roof;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/BuildingEnergyPropertiesAbridged.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, MinLength, MaxLength, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** 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. */
Expand Down Expand Up @@ -50,8 +50,8 @@ export class BuildingEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {

data["type"] = this.type;
data["construction_set"] = this.construction_set;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/BuildingPropertiesAbridged.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsInstance, ValidateNested, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { BuildingEnergyPropertiesAbridged } from "./BuildingEnergyPropertiesAbridged";
import { BuildingRadiancePropertiesAbridged } from "./BuildingRadiancePropertiesAbridged";
Expand Down Expand Up @@ -58,8 +58,8 @@ export class BuildingPropertiesAbridged extends _OpenAPIGenBaseModel {
data["type"] = this.type;
data["energy"] = this.energy;
data["radiance"] = this.radiance;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** 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. */
Expand Down Expand Up @@ -48,8 +48,8 @@ export class BuildingRadiancePropertiesAbridged extends _OpenAPIGenBaseModel {

data["type"] = this.type;
data["modifier_set"] = this.modifier_set;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ContextShade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsArray, IsDefined, IsInstance, ValidateNested, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { ContextShadePropertiesAbridged } from "./ContextShadePropertiesAbridged";
import { Face3D } from "honeybee-schema";
import { IDdBaseModel } from "honeybee-schema";
Expand Down Expand Up @@ -68,8 +68,8 @@ export class ContextShade extends IDdBaseModel {
data["properties"] = this.properties;
data["type"] = this.type;
data["is_detached"] = this.is_detached;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, MinLength, MaxLength, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** 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. */
Expand Down Expand Up @@ -59,8 +59,8 @@ export class ContextShadeEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {
data["type"] = this.type;
data["construction"] = this.construction;
data["transmittance_schedule"] = this.transmittance_schedule;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ContextShadePropertiesAbridged.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsInstance, ValidateNested, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { ContextShadeEnergyPropertiesAbridged } from "./ContextShadeEnergyPropertiesAbridged";
import { ContextShadeRadiancePropertiesAbridged } from "./ContextShadeRadiancePropertiesAbridged";
Expand Down Expand Up @@ -58,8 +58,8 @@ export class ContextShadePropertiesAbridged extends _OpenAPIGenBaseModel {
data["type"] = this.type;
data["energy"] = this.energy;
data["radiance"] = this.radiance;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** 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. */
Expand Down Expand Up @@ -48,8 +48,8 @@ export class ContextShadeRadiancePropertiesAbridged extends _OpenAPIGenBaseModel

data["type"] = this.type;
data["modifier"] = this.modifier;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/DetailedSkylights.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsArray, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { IsNestedNumberArray } from "./../helpers/class-validator";
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

Expand Down Expand Up @@ -58,8 +58,8 @@ export class DetailedSkylights extends _OpenAPIGenBaseModel {
data["polygons"] = this.polygons;
data["type"] = this.type;
data["are_doors"] = this.are_doors;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/DetailedWindows.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsArray, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { IsNestedNumberArray } from "./../helpers/class-validator";
import { _WindowParameterBase } from "./_WindowParameterBase";

Expand Down Expand Up @@ -58,8 +58,8 @@ export class DetailedWindows extends _WindowParameterBase {
data["polygons"] = this.polygons;
data["type"] = this.type;
data["are_doors"] = this.are_doors;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ExteriorApertureGridParameter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsNumber, IsEnum, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _GridParameterBase } from "./_GridParameterBase";
import { ExteriorApertureType } from "./ExteriorApertureType";

Expand Down Expand Up @@ -59,8 +59,8 @@ export class ExteriorApertureGridParameter extends _GridParameterBase {
data["type"] = this.type;
data["offset"] = this.offset;
data["aperture_type"] = this.aperture_type;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ExteriorFaceGridParameter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsNumber, IsEnum, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _GridParameterBase } from "./_GridParameterBase";
import { ExteriorFaceType } from "./ExteriorFaceType";

Expand Down Expand Up @@ -67,8 +67,8 @@ export class ExteriorFaceGridParameter extends _GridParameterBase {
data["offset"] = this.offset;
data["face_type"] = this.face_type;
data["punched_geometry"] = this.punched_geometry;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ExtrudedBorder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsDefined, IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** Extruded borders over all windows in the wall. */
Expand Down Expand Up @@ -48,8 +48,8 @@ export class ExtrudedBorder extends _OpenAPIGenBaseModel {

data["depth"] = this.depth;
data["type"] = this.type;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/GriddedSkylightArea.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsDefined, IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { Autocalculate } from "honeybee-schema";

Expand Down Expand Up @@ -56,8 +56,8 @@ export class GriddedSkylightArea extends _OpenAPIGenBaseModel {
data["skylight_area"] = this.skylight_area;
data["type"] = this.type;
data["spacing"] = this.spacing;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/GriddedSkylightRatio.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsDefined, IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { Autocalculate } from "honeybee-schema";

Expand Down Expand Up @@ -56,8 +56,8 @@ export class GriddedSkylightRatio extends _OpenAPIGenBaseModel {
data["skylight_ratio"] = this.skylight_ratio;
data["type"] = this.type;
data["spacing"] = this.spacing;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/LouversByCount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsInt, IsDefined, IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _LouversBase } from "./_LouversBase";

/** A specific number of louvered Shades over a wall. */
Expand Down Expand Up @@ -48,8 +48,8 @@ export class LouversByCount extends _LouversBase {

data["louver_count"] = this.louver_count;
data["type"] = this.type;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/LouversByDistance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsDefined, IsString, IsOptional, Matches, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _LouversBase } from "./_LouversBase";

/** A series of louvered Shades at a given distance between each louver. */
Expand Down Expand Up @@ -48,8 +48,8 @@ export class LouversByDistance extends _LouversBase {

data["distance"] = this.distance;
data["type"] = this.type;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/Model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsInstance, ValidateNested, IsDefined, IsString, IsOptional, Matches, IsArray, IsEnum, IsNumber, Min, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { Building } from "./Building";
import { ContextShade } from "./ContextShade";
import { IDdBaseModel } from "honeybee-schema";
Expand Down Expand Up @@ -110,8 +110,8 @@ export class Model extends IDdBaseModel {
data["units"] = this.units;
data["tolerance"] = this.tolerance;
data["angle_tolerance"] = this.angle_tolerance;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ModelEnergyProperties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsInstance, ValidateNested, IsArray, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { AirBoundaryConstruction } from "honeybee-schema";
import { AirBoundaryConstructionAbridged } from "honeybee-schema";
Expand Down Expand Up @@ -591,8 +591,8 @@ export class ModelEnergyProperties extends _OpenAPIGenBaseModel {
data["program_types"] = this.program_types;
data["schedules"] = this.schedules;
data["schedule_type_limits"] = this.schedule_type_limits;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ModelProperties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsInstance, ValidateNested, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { ModelEnergyProperties } from "./ModelEnergyProperties";
import { ModelRadianceProperties } from "./ModelRadianceProperties";
Expand Down Expand Up @@ -58,8 +58,8 @@ export class ModelProperties extends _OpenAPIGenBaseModel {
data["type"] = this.type;
data["energy"] = this.energy;
data["radiance"] = this.radiance;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/ModelRadianceProperties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsString, IsOptional, Matches, IsInstance, ValidateNested, IsArray, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";
import { BSDF } from "honeybee-schema";
import { Glass } from "honeybee-schema";
Expand Down Expand Up @@ -238,8 +238,8 @@ export class ModelRadianceProperties extends _OpenAPIGenBaseModel {
data["global_modifier_set"] = this.global_modifier_set;
data["modifier_sets"] = this.modifier_sets;
data["modifiers"] = this.modifiers;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
6 changes: 3 additions & 3 deletions src/TypeScriptSDK/models/Overhang.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsDefined, IsString, IsOptional, Matches, Min, Max, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { Type, plainToClass, instanceToPlain } from 'class-transformer';
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** A single overhang over an entire wall. */
Expand Down Expand Up @@ -58,8 +58,8 @@ export class Overhang extends _OpenAPIGenBaseModel {
data["depth"] = this.depth;
data["type"] = this.type;
data["angle"] = this.angle;
super.toJSON(data);
return data;
data = super.toJSON(data);
return instanceToPlain(data);
}

async validate(): Promise<boolean> {
Expand Down
Loading

0 comments on commit 514e81e

Please sign in to comment.