"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var ChatMessageApi_1 = __importDefault(require("../ChatMessage/ChatMessageApi"));
var ChatConversation_1 = __importDefault(require("./Entity/ChatConversation"));
var ChatConversationApi = /** @class */ (function () {
    function ChatConversationApi(session) {
        this.chatConversationEntity = new ChatConversation_1.default(session);
        this.chatMessage = new ChatMessageApi_1.default(session);
        this.onListUpdate = this.chatConversationEntity.store.onListUpdate;
        this.onItemUpdate = this.chatConversationEntity.store.onItemUpdate;
        this.onItemRemoved = this.chatConversationEntity.store.onItemRemoved;
        this.onItemCreated = this.chatConversationEntity.store.onItemCreated;
    }
    ChatConversationApi.prototype.getConversation = function (id) {
        return this.chatConversationEntity.getConversation(id);
    };
    ChatConversationApi.prototype.getConversations = function (page, options) {
        if (page === void 0) { page = 1; }
        if (options === void 0) { options = {}; }
        return this.chatConversationEntity.getConversations(page, options);
    };
    ChatConversationApi.prototype.createConversation = function (request) {
        return this.chatConversationEntity.createConversation(request);
    };
    ChatConversationApi.prototype.updateLastRead = function (id, serverTimeStamp) {
        return this.chatConversationEntity.updateLastRead(id, serverTimeStamp);
    };
    ChatConversationApi.prototype.fetchMessages = function (request) {
        return this.chatMessage.fetchMessages(request);
    };
    ChatConversationApi.prototype.getChatMessages = function (id) {
        return this.chatMessage.getChatMessages(id);
    };
    ChatConversationApi.prototype.createMessages = function (requests) {
        return this.chatMessage.createMessages(requests);
    };
    return ChatConversationApi;
}());
exports.default = ChatConversationApi;
//# sourceMappingURL=ChatConversationApi.js.map