models/communities/ChatMessagesPagingQuery.js

import ChatMessagesQuery from "./ChatMessagesQuery";

export default class ChatMessagesPagingQuery {
    /**
     * Creates a PagingQuery
     *
     * Only use one cursror at a time.
     * Previous has priortiy over next cursor.
     * Next has priortiy over refresh cursor.
     *
     * @constructor PagingQuery
     * @param {ChatMessagesQuery} query - Query with needed parameters.
     * @param {number} limit - Limit amount of items in the response.
     * @param {string} next - Next cursor received in last response.
     * @param {string} previous - Previous cursor received in last response.
     * @param {string} refresh - Refresh cursor received in last response.
     */
    constructor(query, limit, next, previous, refresh) {
        this.query = query || {};
        this.limit = limit || ChatMessagesPagingQuery.DefaultLimit;
        this.next = next || null;
        this.previous = previous || null;
        this.refresh = refresh || null;
    }
}

ChatMessagesPagingQuery.DefaultLimit = 50;