"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloseRouterRequestT = exports.CloseRouterRequest = 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 CloseRouterRequest {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsCloseRouterRequest(bb, obj) {
        return (obj || new CloseRouterRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsCloseRouterRequest(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new CloseRouterRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    routerId(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    static startCloseRouterRequest(builder) {
        builder.startObject(1);
    }
    static addRouterId(builder, routerIdOffset) {
        builder.addFieldOffset(0, routerIdOffset, 0);
    }
    static endCloseRouterRequest(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // router_id
        return offset;
    }
    static createCloseRouterRequest(builder, routerIdOffset) {
        CloseRouterRequest.startCloseRouterRequest(builder);
        CloseRouterRequest.addRouterId(builder, routerIdOffset);
        return CloseRouterRequest.endCloseRouterRequest(builder);
    }
    unpack() {
        return new CloseRouterRequestT(this.routerId());
    }
    unpackTo(_o) {
        _o.routerId = this.routerId();
    }
}
exports.CloseRouterRequest = CloseRouterRequest;
class CloseRouterRequestT {
    routerId;
    constructor(routerId = null) {
        this.routerId = routerId;
    }
    pack(builder) {
        const routerId = (this.routerId !== null ? builder.createString(this.routerId) : 0);
        return CloseRouterRequest.createCloseRouterRequest(builder, routerId);
    }
}
exports.CloseRouterRequestT = CloseRouterRequestT;
