"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.SctpParametersT = exports.SctpParameters = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class SctpParameters {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsSctpParameters(bb, obj) {
        return (obj || new SctpParameters()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsSctpParameters(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new SctpParameters()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    port() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 5000;
    }
    os() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    mis() {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    maxMessageSize() {
        const offset = this.bb.__offset(this.bb_pos, 10);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    sendBufferSize() {
        const offset = this.bb.__offset(this.bb_pos, 12);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    sctpBufferedAmount() {
        const offset = this.bb.__offset(this.bb_pos, 14);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    isDataChannel() {
        const offset = this.bb.__offset(this.bb_pos, 16);
        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
    }
    static startSctpParameters(builder) {
        builder.startObject(7);
    }
    static addPort(builder, port) {
        builder.addFieldInt16(0, port, 5000);
    }
    static addOs(builder, os) {
        builder.addFieldInt16(1, os, 0);
    }
    static addMis(builder, mis) {
        builder.addFieldInt16(2, mis, 0);
    }
    static addMaxMessageSize(builder, maxMessageSize) {
        builder.addFieldInt32(3, maxMessageSize, 0);
    }
    static addSendBufferSize(builder, sendBufferSize) {
        builder.addFieldInt32(4, sendBufferSize, 0);
    }
    static addSctpBufferedAmount(builder, sctpBufferedAmount) {
        builder.addFieldInt32(5, sctpBufferedAmount, 0);
    }
    static addIsDataChannel(builder, isDataChannel) {
        builder.addFieldInt8(6, +isDataChannel, +false);
    }
    static endSctpParameters(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createSctpParameters(builder, port, os, mis, maxMessageSize, sendBufferSize, sctpBufferedAmount, isDataChannel) {
        SctpParameters.startSctpParameters(builder);
        SctpParameters.addPort(builder, port);
        SctpParameters.addOs(builder, os);
        SctpParameters.addMis(builder, mis);
        SctpParameters.addMaxMessageSize(builder, maxMessageSize);
        SctpParameters.addSendBufferSize(builder, sendBufferSize);
        SctpParameters.addSctpBufferedAmount(builder, sctpBufferedAmount);
        SctpParameters.addIsDataChannel(builder, isDataChannel);
        return SctpParameters.endSctpParameters(builder);
    }
    unpack() {
        return new SctpParametersT(this.port(), this.os(), this.mis(), this.maxMessageSize(), this.sendBufferSize(), this.sctpBufferedAmount(), this.isDataChannel());
    }
    unpackTo(_o) {
        _o.port = this.port();
        _o.os = this.os();
        _o.mis = this.mis();
        _o.maxMessageSize = this.maxMessageSize();
        _o.sendBufferSize = this.sendBufferSize();
        _o.sctpBufferedAmount = this.sctpBufferedAmount();
        _o.isDataChannel = this.isDataChannel();
    }
}
exports.SctpParameters = SctpParameters;
class SctpParametersT {
    port;
    os;
    mis;
    maxMessageSize;
    sendBufferSize;
    sctpBufferedAmount;
    isDataChannel;
    constructor(port = 5000, os = 0, mis = 0, maxMessageSize = 0, sendBufferSize = 0, sctpBufferedAmount = 0, isDataChannel = false) {
        this.port = port;
        this.os = os;
        this.mis = mis;
        this.maxMessageSize = maxMessageSize;
        this.sendBufferSize = sendBufferSize;
        this.sctpBufferedAmount = sctpBufferedAmount;
        this.isDataChannel = isDataChannel;
    }
    pack(builder) {
        return SctpParameters.createSctpParameters(builder, this.port, this.os, this.mis, this.maxMessageSize, this.sendBufferSize, this.sctpBufferedAmount, this.isDataChannel);
    }
}
exports.SctpParametersT = SctpParametersT;
