"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deserializeGetAccountQueueCountReq = exports.serializeGetAccountQueueCountReq = exports.cGetAccountQueueCountReqVersion = void 0;
const Helpers_1 = require("./ajv/Helpers");
const AJVSchemaEnum_1 = require("./enum/AJVSchemaEnum");
const TypeIdentifierEnum_1 = require("./enum/TypeIdentifierEnum");
exports.cGetAccountQueueCountReqVersion = 1;
function serializeGetAccountQueueCountReq(stream, obj, root = false) {
    if (root) {
        stream.writeUInt16(TypeIdentifierEnum_1.TypeIdentifierEnum.cGetAccountQueueCountReq);
    }
    stream.writeUInt8(exports.cGetAccountQueueCountReqVersion);
    stream.writeUInt32(obj.accountIds.length);
    for (const accountId of obj.accountIds) {
        stream.writeString(accountId);
    }
}
exports.serializeGetAccountQueueCountReq = serializeGetAccountQueueCountReq;
function deserializeGetAccountQueueCountReq(stream) {
    const version = stream.readUInt8();
    if (version > exports.cGetAccountQueueCountReqVersion) {
        throw new Error('GetAccountQueueCountReq version mismatch');
    }
    const length = stream.readUInt32();
    const accountIds = [];
    for (let i = 0; i < length; i++) {
        accountIds.push(stream.readString());
    }
    const errors = (0, Helpers_1.verifyPayload)(AJVSchemaEnum_1.AJVSchemaEnum.GetAccountQueueCountReq, { accountIds });
    if (errors && errors.length > 0) {
        throw new Error('Data validation error');
    }
    return {
        accountIds,
    };
}
exports.deserializeGetAccountQueueCountReq = deserializeGetAccountQueueCountReq;
//# sourceMappingURL=GetAccountQueueCountReq.js.map