"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddSubchannelRequestT = exports.AddSubchannelRequest = 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 AddSubchannelRequest {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsAddSubchannelRequest(bb, obj) {
        return (obj || new AddSubchannelRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsAddSubchannelRequest(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new AddSubchannelRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    subchannel() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    static startAddSubchannelRequest(builder) {
        builder.startObject(1);
    }
    static addSubchannel(builder, subchannel) {
        builder.addFieldInt16(0, subchannel, 0);
    }
    static endAddSubchannelRequest(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createAddSubchannelRequest(builder, subchannel) {
        AddSubchannelRequest.startAddSubchannelRequest(builder);
        AddSubchannelRequest.addSubchannel(builder, subchannel);
        return AddSubchannelRequest.endAddSubchannelRequest(builder);
    }
    unpack() {
        return new AddSubchannelRequestT(this.subchannel());
    }
    unpackTo(_o) {
        _o.subchannel = this.subchannel();
    }
}
exports.AddSubchannelRequest = AddSubchannelRequest;
class AddSubchannelRequestT {
    subchannel;
    constructor(subchannel = 0) {
        this.subchannel = subchannel;
    }
    pack(builder) {
        return AddSubchannelRequest.createAddSubchannelRequest(builder, this.subchannel);
    }
}
exports.AddSubchannelRequestT = AddSubchannelRequestT;
