@cloudize/sdk-core 23.2.3 → 23.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -54,4 +54,5 @@ export default class ResourceContainer implements IResourceContainer {
|
|
|
54
54
|
Include(include: ResourceIncludeOption): IResourceContainer;
|
|
55
55
|
PageOffset(pageOffset: number, pageSize: number): IResourceContainer;
|
|
56
56
|
PageNumber(pageNumber: number, pageSize: number): IResourceContainer;
|
|
57
|
+
toJSON(): any;
|
|
57
58
|
}
|
|
@@ -318,5 +318,20 @@ class ResourceContainer {
|
|
|
318
318
|
this._queryParams.pagination.size = pageSize;
|
|
319
319
|
return this;
|
|
320
320
|
}
|
|
321
|
+
toJSON() {
|
|
322
|
+
if ((0, json_1.isDefined)(this.data)) {
|
|
323
|
+
if ((0, __1.isResourceObject)(this.data))
|
|
324
|
+
return this.data.toJSON();
|
|
325
|
+
if ((0, json_1.isArrayOfObjects)(this.data)) {
|
|
326
|
+
const payload = [];
|
|
327
|
+
for (const resource of this.data) {
|
|
328
|
+
if ((0, __1.isResourceObject)(resource))
|
|
329
|
+
payload.push(resource.toJSON);
|
|
330
|
+
}
|
|
331
|
+
return payload;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
321
336
|
}
|
|
322
337
|
exports.default = ResourceContainer;
|