From c395293e64d5e8e276ede7ed84649fadde60dcb0 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 5 Apr 2021 11:13:34 -0500 Subject: [PATCH] Deep parse models (#321) --- src/models/response/attachmentUploadDataResponse.ts | 6 ++++-- src/models/response/sendFileUploadDataResponse.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/models/response/attachmentUploadDataResponse.ts b/src/models/response/attachmentUploadDataResponse.ts index 117ab6fa9f..dd71276c99 100644 --- a/src/models/response/attachmentUploadDataResponse.ts +++ b/src/models/response/attachmentUploadDataResponse.ts @@ -12,8 +12,10 @@ export class AttachmentUploadDataResponse extends BaseResponse { super(response); this.attachmentId = this.getResponseProperty('AttachmentId'); this.fileUploadType = this.getResponseProperty('FileUploadType'); - this.cipherResponse = this.getResponseProperty('CipherResponse'); - this.cipherMiniResponse = this.getResponseProperty('CipherMiniResponse'); + const cipherResponse = this.getResponseProperty('CipherResponse'); + const cipherMiniResponse = this.getResponseProperty('CipherMiniResponse'); + this.cipherResponse = cipherResponse == null ? null : new CipherResponse(cipherResponse); + this.cipherMiniResponse = cipherMiniResponse == null ? null : new CipherResponse(cipherMiniResponse); this.url = this.getResponseProperty('Url'); } diff --git a/src/models/response/sendFileUploadDataResponse.ts b/src/models/response/sendFileUploadDataResponse.ts index 3dce1fce59..3f7f0b3db6 100644 --- a/src/models/response/sendFileUploadDataResponse.ts +++ b/src/models/response/sendFileUploadDataResponse.ts @@ -11,7 +11,8 @@ export class SendFileUploadDataResponse extends BaseResponse { constructor(response: any) { super(response); this.fileUploadType = this.getResponseProperty('FileUploadType'); - this.sendResponse = this.getResponseProperty('SendResponse'); + const sendResponse = this.getResponseProperty('SendResponse'); + this.sendResponse = sendResponse == null ? null : new SendResponse(sendResponse); this.url = this.getResponseProperty('Url'); } }