"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloseTransportRequestT = exports.CloseTransportRequest = 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 CloseTransportRequest {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsCloseTransportRequest(bb, obj) {
        return (obj || new CloseTransportRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsCloseTransportRequest(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new CloseTransportRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    transportId(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    static startCloseTransportRequest(builder) {
        builder.startObject(1);
    }
    static addTransportId(builder, transportIdOffset) {
        builder.addFieldOffset(0, transportIdOffset, 0);
    }
    static endCloseTransportRequest(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // transport_id
        return offset;
    }
    static createCloseTransportRequest(builder, transportIdOffset) {
        CloseTransportRequest.startCloseTransportRequest(builder);
        CloseTransportRequest.addTransportId(builder, transportIdOffset);
        return CloseTransportRequest.endCloseTransportRequest(builder);
    }
    unpack() {
        return new CloseTransportRequestT(this.transportId());
    }
    unpackTo(_o) {
        _o.transportId = this.transportId();
    }
}
exports.CloseTransportRequest = CloseTransportRequest;
class CloseTransportRequestT {
    transportId;
    constructor(transportId = null) {
        this.transportId = transportId;
    }
    pack(builder) {
        const transportId = (this.transportId !== null ? builder.createString(this.transportId) : 0);
        return CloseTransportRequest.createCloseTransportRequest(builder, transportId);
    }
}
exports.CloseTransportRequestT = CloseTransportRequestT;
