"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.DumpResponseT = exports.DumpResponse = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
const string_string_1 = require("../../fbs/common/string-string");
const string_string_array_1 = require("../../fbs/common/string-string-array");
class DumpResponse {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsDumpResponse(bb, obj) {
        return (obj || new DumpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsDumpResponse(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new DumpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    id(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    transportIds(index, optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
    }
    transportIdsLength() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    rtpObserverIds(index, optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
    }
    rtpObserverIdsLength() {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    mapProducerIdConsumerIds(index, obj) {
        const offset = this.bb.__offset(this.bb_pos, 10);
        return offset ? (obj || new string_string_array_1.StringStringArray()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
    }
    mapProducerIdConsumerIdsLength() {
        const offset = this.bb.__offset(this.bb_pos, 10);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    mapConsumerIdProducerId(index, obj) {
        const offset = this.bb.__offset(this.bb_pos, 12);
        return offset ? (obj || new string_string_1.StringString()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
    }
    mapConsumerIdProducerIdLength() {
        const offset = this.bb.__offset(this.bb_pos, 12);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    mapProducerIdObserverIds(index, obj) {
        const offset = this.bb.__offset(this.bb_pos, 14);
        return offset ? (obj || new string_string_array_1.StringStringArray()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
    }
    mapProducerIdObserverIdsLength() {
        const offset = this.bb.__offset(this.bb_pos, 14);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    mapDataProducerIdDataConsumerIds(index, obj) {
        const offset = this.bb.__offset(this.bb_pos, 16);
        return offset ? (obj || new string_string_array_1.StringStringArray()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
    }
    mapDataProducerIdDataConsumerIdsLength() {
        const offset = this.bb.__offset(this.bb_pos, 16);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    mapDataConsumerIdDataProducerId(index, obj) {
        const offset = this.bb.__offset(this.bb_pos, 18);
        return offset ? (obj || new string_string_1.StringString()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
    }
    mapDataConsumerIdDataProducerIdLength() {
        const offset = this.bb.__offset(this.bb_pos, 18);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    static startDumpResponse(builder) {
        builder.startObject(8);
    }
    static addId(builder, idOffset) {
        builder.addFieldOffset(0, idOffset, 0);
    }
    static addTransportIds(builder, transportIdsOffset) {
        builder.addFieldOffset(1, transportIdsOffset, 0);
    }
    static createTransportIdsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startTransportIdsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addRtpObserverIds(builder, rtpObserverIdsOffset) {
        builder.addFieldOffset(2, rtpObserverIdsOffset, 0);
    }
    static createRtpObserverIdsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startRtpObserverIdsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addMapProducerIdConsumerIds(builder, mapProducerIdConsumerIdsOffset) {
        builder.addFieldOffset(3, mapProducerIdConsumerIdsOffset, 0);
    }
    static createMapProducerIdConsumerIdsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startMapProducerIdConsumerIdsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addMapConsumerIdProducerId(builder, mapConsumerIdProducerIdOffset) {
        builder.addFieldOffset(4, mapConsumerIdProducerIdOffset, 0);
    }
    static createMapConsumerIdProducerIdVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startMapConsumerIdProducerIdVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addMapProducerIdObserverIds(builder, mapProducerIdObserverIdsOffset) {
        builder.addFieldOffset(5, mapProducerIdObserverIdsOffset, 0);
    }
    static createMapProducerIdObserverIdsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startMapProducerIdObserverIdsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addMapDataProducerIdDataConsumerIds(builder, mapDataProducerIdDataConsumerIdsOffset) {
        builder.addFieldOffset(6, mapDataProducerIdDataConsumerIdsOffset, 0);
    }
    static createMapDataProducerIdDataConsumerIdsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startMapDataProducerIdDataConsumerIdsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static addMapDataConsumerIdDataProducerId(builder, mapDataConsumerIdDataProducerIdOffset) {
        builder.addFieldOffset(7, mapDataConsumerIdDataProducerIdOffset, 0);
    }
    static createMapDataConsumerIdDataProducerIdVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startMapDataConsumerIdDataProducerIdVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static endDumpResponse(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // id
        builder.requiredField(offset, 6); // transport_ids
        builder.requiredField(offset, 8); // rtp_observer_ids
        builder.requiredField(offset, 10); // map_producer_id_consumer_ids
        builder.requiredField(offset, 12); // map_consumer_id_producer_id
        builder.requiredField(offset, 14); // map_producer_id_observer_ids
        builder.requiredField(offset, 16); // map_data_producer_id_data_consumer_ids
        builder.requiredField(offset, 18); // map_data_consumer_id_data_producer_id
        return offset;
    }
    static createDumpResponse(builder, idOffset, transportIdsOffset, rtpObserverIdsOffset, mapProducerIdConsumerIdsOffset, mapConsumerIdProducerIdOffset, mapProducerIdObserverIdsOffset, mapDataProducerIdDataConsumerIdsOffset, mapDataConsumerIdDataProducerIdOffset) {
        DumpResponse.startDumpResponse(builder);
        DumpResponse.addId(builder, idOffset);
        DumpResponse.addTransportIds(builder, transportIdsOffset);
        DumpResponse.addRtpObserverIds(builder, rtpObserverIdsOffset);
        DumpResponse.addMapProducerIdConsumerIds(builder, mapProducerIdConsumerIdsOffset);
        DumpResponse.addMapConsumerIdProducerId(builder, mapConsumerIdProducerIdOffset);
        DumpResponse.addMapProducerIdObserverIds(builder, mapProducerIdObserverIdsOffset);
        DumpResponse.addMapDataProducerIdDataConsumerIds(builder, mapDataProducerIdDataConsumerIdsOffset);
        DumpResponse.addMapDataConsumerIdDataProducerId(builder, mapDataConsumerIdDataProducerIdOffset);
        return DumpResponse.endDumpResponse(builder);
    }
    unpack() {
        return new DumpResponseT(this.id(), this.bb.createScalarList(this.transportIds.bind(this), this.transportIdsLength()), this.bb.createScalarList(this.rtpObserverIds.bind(this), this.rtpObserverIdsLength()), this.bb.createObjList(this.mapProducerIdConsumerIds.bind(this), this.mapProducerIdConsumerIdsLength()), this.bb.createObjList(this.mapConsumerIdProducerId.bind(this), this.mapConsumerIdProducerIdLength()), this.bb.createObjList(this.mapProducerIdObserverIds.bind(this), this.mapProducerIdObserverIdsLength()), this.bb.createObjList(this.mapDataProducerIdDataConsumerIds.bind(this), this.mapDataProducerIdDataConsumerIdsLength()), this.bb.createObjList(this.mapDataConsumerIdDataProducerId.bind(this), this.mapDataConsumerIdDataProducerIdLength()));
    }
    unpackTo(_o) {
        _o.id = this.id();
        _o.transportIds = this.bb.createScalarList(this.transportIds.bind(this), this.transportIdsLength());
        _o.rtpObserverIds = this.bb.createScalarList(this.rtpObserverIds.bind(this), this.rtpObserverIdsLength());
        _o.mapProducerIdConsumerIds = this.bb.createObjList(this.mapProducerIdConsumerIds.bind(this), this.mapProducerIdConsumerIdsLength());
        _o.mapConsumerIdProducerId = this.bb.createObjList(this.mapConsumerIdProducerId.bind(this), this.mapConsumerIdProducerIdLength());
        _o.mapProducerIdObserverIds = this.bb.createObjList(this.mapProducerIdObserverIds.bind(this), this.mapProducerIdObserverIdsLength());
        _o.mapDataProducerIdDataConsumerIds = this.bb.createObjList(this.mapDataProducerIdDataConsumerIds.bind(this), this.mapDataProducerIdDataConsumerIdsLength());
        _o.mapDataConsumerIdDataProducerId = this.bb.createObjList(this.mapDataConsumerIdDataProducerId.bind(this), this.mapDataConsumerIdDataProducerIdLength());
    }
}
exports.DumpResponse = DumpResponse;
class DumpResponseT {
    id;
    transportIds;
    rtpObserverIds;
    mapProducerIdConsumerIds;
    mapConsumerIdProducerId;
    mapProducerIdObserverIds;
    mapDataProducerIdDataConsumerIds;
    mapDataConsumerIdDataProducerId;
    constructor(id = null, transportIds = [], rtpObserverIds = [], mapProducerIdConsumerIds = [], mapConsumerIdProducerId = [], mapProducerIdObserverIds = [], mapDataProducerIdDataConsumerIds = [], mapDataConsumerIdDataProducerId = []) {
        this.id = id;
        this.transportIds = transportIds;
        this.rtpObserverIds = rtpObserverIds;
        this.mapProducerIdConsumerIds = mapProducerIdConsumerIds;
        this.mapConsumerIdProducerId = mapConsumerIdProducerId;
        this.mapProducerIdObserverIds = mapProducerIdObserverIds;
        this.mapDataProducerIdDataConsumerIds = mapDataProducerIdDataConsumerIds;
        this.mapDataConsumerIdDataProducerId = mapDataConsumerIdDataProducerId;
    }
    pack(builder) {
        const id = (this.id !== null ? builder.createString(this.id) : 0);
        const transportIds = DumpResponse.createTransportIdsVector(builder, builder.createObjectOffsetList(this.transportIds));
        const rtpObserverIds = DumpResponse.createRtpObserverIdsVector(builder, builder.createObjectOffsetList(this.rtpObserverIds));
        const mapProducerIdConsumerIds = DumpResponse.createMapProducerIdConsumerIdsVector(builder, builder.createObjectOffsetList(this.mapProducerIdConsumerIds));
        const mapConsumerIdProducerId = DumpResponse.createMapConsumerIdProducerIdVector(builder, builder.createObjectOffsetList(this.mapConsumerIdProducerId));
        const mapProducerIdObserverIds = DumpResponse.createMapProducerIdObserverIdsVector(builder, builder.createObjectOffsetList(this.mapProducerIdObserverIds));
        const mapDataProducerIdDataConsumerIds = DumpResponse.createMapDataProducerIdDataConsumerIdsVector(builder, builder.createObjectOffsetList(this.mapDataProducerIdDataConsumerIds));
        const mapDataConsumerIdDataProducerId = DumpResponse.createMapDataConsumerIdDataProducerIdVector(builder, builder.createObjectOffsetList(this.mapDataConsumerIdDataProducerId));
        return DumpResponse.createDumpResponse(builder, id, transportIds, rtpObserverIds, mapProducerIdConsumerIds, mapConsumerIdProducerId, mapProducerIdObserverIds, mapDataProducerIdDataConsumerIds, mapDataConsumerIdDataProducerId);
    }
}
exports.DumpResponseT = DumpResponseT;
