2023-02-02 16:07:00 -06:00
|
|
|
/**
|
|
|
|
|
* @class CollectionResponse - A generic object for responses that contain collections of objects.
|
|
|
|
|
*/
|
|
|
|
|
export class CollectionResponse<T> {
|
|
|
|
|
/**
|
|
|
|
|
* @property {number} count - The total count of items in the collection.
|
|
|
|
|
*/
|
|
|
|
|
public count: number;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @property {T} items - The items in the collection.
|
|
|
|
|
*/
|
2023-02-02 20:24:20 -06:00
|
|
|
public items: T[];
|
2023-02-02 16:07:00 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @constructor - Creates a new instance of the CollectionResponse class.
|
|
|
|
|
* @param {number} count - The total count of items in the collection.
|
|
|
|
|
* @param {T} items - The items in the collection.
|
|
|
|
|
* @returns {CollectionResponse<T>} - A new instance of the CollectionResponse.
|
|
|
|
|
*/
|
2023-02-02 20:24:20 -06:00
|
|
|
constructor(count: number, items: T[]) {
|
2023-02-02 16:07:00 -06:00
|
|
|
this.count = count;
|
|
|
|
|
this.items = items;
|
|
|
|
|
}
|
|
|
|
|
}
|