"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectTransportOptionsT = exports.DirectTransportOptions = 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 options_1 = require("../../fbs/transport/options");
class DirectTransportOptions {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsDirectTransportOptions(bb, obj) {
        return (obj || new DirectTransportOptions()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsDirectTransportOptions(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new DirectTransportOptions()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    base(obj) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? (obj || new options_1.Options()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
    }
    static startDirectTransportOptions(builder) {
        builder.startObject(1);
    }
    static addBase(builder, baseOffset) {
        builder.addFieldOffset(0, baseOffset, 0);
    }
    static endDirectTransportOptions(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // base
        return offset;
    }
    static createDirectTransportOptions(builder, baseOffset) {
        DirectTransportOptions.startDirectTransportOptions(builder);
        DirectTransportOptions.addBase(builder, baseOffset);
        return DirectTransportOptions.endDirectTransportOptions(builder);
    }
    unpack() {
        return new DirectTransportOptionsT((this.base() !== null ? this.base().unpack() : null));
    }
    unpackTo(_o) {
        _o.base = (this.base() !== null ? this.base().unpack() : null);
    }
}
exports.DirectTransportOptions = DirectTransportOptions;
class DirectTransportOptionsT {
    base;
    constructor(base = null) {
        this.base = base;
    }
    pack(builder) {
        const base = (this.base !== null ? this.base.pack(builder) : 0);
        return DirectTransportOptions.createDirectTransportOptions(builder, base);
    }
}
exports.DirectTransportOptionsT = DirectTransportOptionsT;
