UNPKG

kentico-cloud-delivery

Version:

Official Kentico Cloud Delivery SDK

65 lines 2.4 kB
"use strict"; exports.__esModule = true; var ItemResponses; (function (ItemResponses) { var DeliveryItemListingResponse = /** @class */ (function () { /** * Response containing multiple item * @constructor * @param {TItem[]} items - Collection of content items * @param {Pagination} pagination - Pagination object * @param {ICloudResponseDebug} debug - Debug information from the request */ function DeliveryItemListingResponse(items, pagination, debug) { this.items = items; this.pagination = pagination; this.debug = debug; this.initIsEmpty(); this.initFirstAndLastItem(); } DeliveryItemListingResponse.prototype.initIsEmpty = function () { if (!this.items) { this.isEmpty = true; } else { this.isEmpty = this.items.length <= 0; } }; DeliveryItemListingResponse.prototype.initFirstAndLastItem = function () { if (!this.items) { return; } if (this.items.length < 1) { return; } this.firstItem = this.items[0]; this.lastItem = this.items[this.items.length - 1]; }; return DeliveryItemListingResponse; }()); ItemResponses.DeliveryItemListingResponse = DeliveryItemListingResponse; var DeliveryItemResponse = /** @class */ (function () { /** * Response containing single item * @constructor * @param {TItem} item - Returned item * @param {ICloudResponseDebug} debug - Debug information from the request */ function DeliveryItemResponse(item, debug) { this.item = item; this.debug = debug; this.initIsEmpty(); } DeliveryItemResponse.prototype.initIsEmpty = function () { if (!this.item) { this.isEmpty = true; } else { this.isEmpty = false; } }; return DeliveryItemResponse; }()); ItemResponses.DeliveryItemResponse = DeliveryItemResponse; })(ItemResponses = exports.ItemResponses || (exports.ItemResponses = {})); //# sourceMappingURL=responses.js.map