summaryrefslogtreecommitdiff
path: root/classes/Attachment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Attachment.ts')
-rw-r--r--classes/Attachment.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/classes/Attachment.ts b/classes/Attachment.ts
new file mode 100644
index 0000000..a397924
--- /dev/null
+++ b/classes/Attachment.ts
@@ -0,0 +1,22 @@
+import {IMimeType} from "../types/IMimeType";
+import {AttachmentSize} from "./AttachmentSize";
+
+export class Attachment {
+ public type: IMimeType;
+ public fileName: string;
+ public fileId: string;
+ public size: AttachmentSize;
+ public width?: number;
+ public height?: number;
+ public caption?: string;
+
+ constructor(attachmentData: any) {
+ this.type = attachmentData.contentType;
+ this.fileName = attachmentData.filename;
+ this.fileId = attachmentData.id;
+ this.size = new AttachmentSize(attachmentData.size);
+ this.width = attachmentData.width;
+ this.height = attachmentData.height;
+ this.caption = attachmentData.caption;
+ }
+} \ No newline at end of file