Files
onspring-api-sdk-javascript/src/models/FileInfo.ts
T

37 lines
841 B
TypeScript
Raw Normal View History

2023-02-04 15:09:13 -06:00
import { FieldType } from '../enums/FieldType';
export class FileInfo {
public type: FieldType;
public contentType: string;
public name: string;
public createdDate: Date;
public modifiedDate: Date;
public owner: string;
public notes: string;
public fileHref: string;
constructor(
type: string,
contentType: string,
name: string,
createdDate: Date,
modifiedDate: Date,
owner: string,
notes: string,
fileHref: string
) {
if (FieldType[type] === undefined) {
throw new Error(`The type '${type}' is not a valid FieldType.`);
}
this.type = FieldType[type];
this.contentType = contentType;
this.name = name;
this.createdDate = createdDate;
this.modifiedDate = modifiedDate;
this.owner = owner;
this.notes = notes;
this.fileHref = fileHref;
}
}