Skip to content

Commit

Permalink
fix(Ts): regenerate Ts
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Sep 10, 2024
1 parent d9410cc commit 41cdc4b
Show file tree
Hide file tree
Showing 45 changed files with 58 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/DragonflySchema/DragonflySchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>1.12.1-v6</Version>
<Version>1.12.1-v8</Version>
<Authors>Ladybug Tools</Authors>
<Description>This is the .Net version of Dragonfly Schema</Description>
<Copyright>Copyright © 2024 Ladybug Tools LLC</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/Building.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class Building extends IDdBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class BuildingEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/BuildingPropertiesAbridged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class BuildingPropertiesAbridged extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class BuildingRadiancePropertiesAbridged extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ContextShade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ContextShade extends IDdBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ContextShadeEnergyPropertiesAbridged extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ContextShadePropertiesAbridged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ContextShadePropertiesAbridged extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ContextShadeRadiancePropertiesAbridged extends _OpenAPIGenBaseModel
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
13 changes: 4 additions & 9 deletions src/TypeScriptSDK/models/DetailedSkylights.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { IsArray, ValidateNested, IsNumber, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { IsArray, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { IsNestedNumberArray } from "./../helpers/class-validator";
import { _OpenAPIGenBaseModel } from "./_OpenAPIGenBaseModel";

/** Several detailed skylights defined by 2D Polygons (lists of 2D vertices). */
export class DetailedSkylights extends _OpenAPIGenBaseModel {
@IsArray()
@IsArray({ each: true })
@ValidateNested({each: true })
@Type(() => Array)
@IsArray({ each: true })
@ValidateNested({each: true })
@Type(() => Array)
@IsNumber({},{ each: true })
@IsNestedNumberArray()
@IsDefined()
/** An array of arrays with each sub-array representing a polygonal boundary of a skylight. Each sub-array should consist of arrays representing points, which contain 2 values for 2D coordinates in the world XY system. These coordinate values should lie within the parent Room2D Polygon. */
polygons!: number [] [] [];
Expand Down Expand Up @@ -70,7 +65,7 @@ export class DetailedSkylights extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
13 changes: 4 additions & 9 deletions src/TypeScriptSDK/models/DetailedWindows.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { IsArray, ValidateNested, IsNumber, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { IsArray, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { IsNestedNumberArray } from "./../helpers/class-validator";
import { _WindowParameterBase } from "./_WindowParameterBase";

/** Several detailed windows defined by 2D Polygons (lists of 2D vertices). */
export class DetailedWindows extends _WindowParameterBase {
@IsArray()
@IsArray({ each: true })
@ValidateNested({each: true })
@Type(() => Array)
@IsArray({ each: true })
@ValidateNested({each: true })
@Type(() => Array)
@IsNumber({},{ each: true })
@IsNestedNumberArray()
@IsDefined()
/** An array of arrays with each sub-array representing a polygonal boundary of a window. Each sub-array should consist of arrays representing points, which can either contain 2 values (indicating they are 2D vertices within the plane of a parent wall segment) or they can contain 3 values (indicating they are 3D world coordinates). For 2D points, the wall plane is assumed to have an origin at the first point of the wall segment and an X-axis extending along the length of the segment. The wall plane Y-axis always points upwards. Therefore, both X and Y values of each point in the polygon should always be positive. Some sample code to convert from 2D vertices to 2D vertices in the plane of the wall can be found here: https://www.ladybug.tools/dragonfly-core/docs/dragonfly.windowparameter.html#dragonfly.windowparameter.DetailedWindows */
polygons!: number [] [] [];
Expand Down Expand Up @@ -70,7 +65,7 @@ export class DetailedWindows extends _WindowParameterBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ExteriorApertureGridParameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ExteriorApertureGridParameter extends _GridParameterBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ExteriorFaceGridParameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class ExteriorFaceGridParameter extends _GridParameterBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ExtrudedBorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ExtrudedBorder extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/GriddedSkylightArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class GriddedSkylightArea extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/GriddedSkylightRatio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class GriddedSkylightRatio extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/LouversByCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class LouversByCount extends _LouversBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/LouversByDistance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class LouversByDistance extends _LouversBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Model extends IDdBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ModelEnergyProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ export class ModelEnergyProperties extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ModelProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ModelProperties extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/ModelRadianceProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class ModelRadianceProperties extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/Overhang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Overhang extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
10 changes: 4 additions & 6 deletions src/TypeScriptSDK/models/RectangularWindows.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { IsArray, ValidateNested, IsNumber, IsDefined, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { IsArray, IsDefined, IsNumber, IsString, IsOptional, Matches, IsBoolean, validate, ValidationError as TsValidationError } from 'class-validator';
import { Type, plainToClass } from 'class-transformer';
import { IsNestedNumberArray } from "./../helpers/class-validator";
import { _WindowParameterBase } from "./_WindowParameterBase";

/** Several rectangular windows, defined by origin, width and height. */
export class RectangularWindows extends _WindowParameterBase {
@IsArray()
@IsArray({ each: true })
@ValidateNested({each: true })
@Type(() => Array)
@IsNumber({},{ each: true })
@IsNestedNumberArray()
@IsDefined()
/** An array of 2D points within the plane of the wall for the origin of each window. Each point should be a list of 2 (x, y) values. The wall plane is assumed to have an origin at the first point of the wall segment and an X-axis extending along the length of the segment. The wall plane Y-axis always points upwards. Therefore, both X and Y values of each origin point should be positive. */
origins!: number [] [];
Expand Down Expand Up @@ -83,7 +81,7 @@ export class RectangularWindows extends _WindowParameterBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/RepeatingWindowRatio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class RepeatingWindowRatio extends _WindowParameterBase {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/TypeScriptSDK/models/RoofSpecification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class RoofSpecification extends _OpenAPIGenBaseModel {
async validate(): Promise<boolean> {
const errors = await validate(this);
if (errors.length > 0){
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error.property]).join(', ')).join('; ');
const errorMessages = errors.map((error: TsValidationError) => Object.values(error.constraints || [error]).join(', ')).join('; ');
throw new Error(`Validation failed: ${errorMessages}`);
}
return true;
Expand Down
Loading

0 comments on commit 41cdc4b

Please sign in to comment.